]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - support/nfs/nfssvc.c
Further coverity related cleanups.
[nfs-utils.git] / support / nfs / nfssvc.c
index dae16f7f7adc59a540b565e210e8861f71cacd37..38240a020f190ffbe12c5591752929e1c6baed30 100644 (file)
@@ -6,7 +6,9 @@
  * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
  */
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include <unistd.h>
 #include <fcntl.h>
@@ -19,7 +21,9 @@ nfssvc(int port, int nrservs)
        struct nfsctl_arg       arg;
        int fd;
 
-       fd = open("/proc/fs/nfs/threads", O_WRONLY);
+       fd = open("/proc/fs/nfsd/threads", O_WRONLY);
+       if (fd < 0)
+               fd = open("/proc/fs/nfs/threads", O_WRONLY);
        if (fd >= 0) {
                /* 2.5+ kernel with nfsd filesystem mounted.
                 * Just write the number in.