diff options
Diffstat (limited to 'utils/mountd/mountd.c')
-rw-r--r-- | utils/mountd/mountd.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c index 8779afe..14f5fa2 100644 --- a/utils/mountd/mountd.c +++ b/utils/mountd/mountd.c @@ -14,6 +14,7 @@ #include <arpa/inet.h> #include <unistd.h> #include <stdlib.h> +#include <string.h> #include <getopt.h> #include <errno.h> #include <fcntl.h> @@ -440,6 +441,12 @@ main(int argc, char **argv) if (optind != argc || !(nfs_version & 0x7)) usage(argv [0], 1); + if (chdir(NFS_STATEDIR)) { + fprintf(stderr, "%s: chdir(%s) failed: %s\n", + argv [0], NFS_STATEDIR, strerror(errno)); + exit(1); + } + /* Initialize logging. */ /* xlog_open("mountd"); */ |