]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/rquotad/rquota_svc.c
2001-05-28 H.J. Lu <hjl@lucon.org>
[nfs-utils.git] / utils / rquotad / rquota_svc.c
index 104ba7eb8946cdb2675439f84d5896eaefd4c016..e1149664ced37639518c042b22fe890bc1ff97ea 100644 (file)
@@ -25,6 +25,7 @@
 #endif
 
 #include <unistd.h>
+#include <errno.h>
 #include <rpc/rpc.h>
 #include "rquota.h"
 #include <stdlib.h>
@@ -254,6 +255,13 @@ int main(int argc, char **argv)
      }
    }
 
+   if (chdir(NFS_STATEDIR)) {
+     fprintf(stderr, "%s: chdir(%s) failed: %s\n",
+            argv [0], NFS_STATEDIR, strerror(errno));
+
+     exit(1);
+   }
+
    /* WARNING: the following works on Linux and SysV, but not BSD! */
    signal(SIGCHLD, SIG_IGN);