utils/nfs-ls: dont use nfs_mt_service_thread_ if not built with HAVE_MULTITHREADING
parent
680ceb8d2c
commit
fe62199737
|
@ -165,7 +165,9 @@ int main(int argc, char *argv[])
|
||||||
struct client client;
|
struct client client;
|
||||||
struct statvfs stvfs;
|
struct statvfs stvfs;
|
||||||
struct nfs_url *url = NULL;
|
struct nfs_url *url = NULL;
|
||||||
|
#ifdef HAVE_MULTITHREADING
|
||||||
int mt_started = 0;
|
int mt_started = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
if (WSAStartup(MAKEWORD(2,2), &wsaData) != 0) {
|
if (WSAStartup(MAKEWORD(2,2), &wsaData) != 0) {
|
||||||
|
@ -247,6 +249,8 @@ int main(int argc, char *argv[])
|
||||||
fprintf(stderr, "Failed to mount nfs share : %s\n", nfs_get_error(nfs));
|
fprintf(stderr, "Failed to mount nfs share : %s\n", nfs_get_error(nfs));
|
||||||
goto finished;
|
goto finished;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_MULTITHREADING
|
||||||
/*
|
/*
|
||||||
* Before we can use multithreading we must initialize and
|
* Before we can use multithreading we must initialize and
|
||||||
* start the service thread.
|
* start the service thread.
|
||||||
|
@ -256,6 +260,7 @@ int main(int argc, char *argv[])
|
||||||
exit(10);
|
exit(10);
|
||||||
}
|
}
|
||||||
mt_started = 1;
|
mt_started = 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
process_dir(nfs, "", 16);
|
process_dir(nfs, "", 16);
|
||||||
|
|
||||||
|
@ -270,10 +275,12 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
finished:
|
finished:
|
||||||
|
#ifdef HAVE_MULTITHREADING
|
||||||
if (mt_started) {
|
if (mt_started) {
|
||||||
printf("closing service thread\n");
|
printf("closing service thread\n");
|
||||||
nfs_mt_service_thread_stop(nfs);
|
nfs_mt_service_thread_stop(nfs);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
print_usage();
|
print_usage();
|
||||||
|
|
Loading…
Reference in New Issue