X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=utils%2Fstatd%2Fstatd.c;h=4fc135abee256c58484947734f3e8a415aa85787;hb=3ce25efd1c72fedeba514b8c14748364c42f21e4;hp=3d90d641851aa26c86f5920b6bdd38976db8f9df;hpb=9ee7da8230adead93a1b42b1ac2c78e02227fe15;p=nfs-utils.git diff --git a/utils/statd/statd.c b/utils/statd/statd.c index 3d90d64..4fc135a 100644 --- a/utils/statd/statd.c +++ b/utils/statd/statd.c @@ -42,6 +42,7 @@ static struct option longopts[] = { "version", 0, 0, 'v' }, { "outgoing-port", 1, 0, 'o' }, { "port", 1, 0, 'p' }, + { "name", 1, 0, 'n' }, { NULL, 0, 0, 0 } }; @@ -126,6 +127,7 @@ usage() fprintf(stderr," -p, --port Port to listen on\n"); fprintf(stderr," -o, --outgoing-port Port for outgoing connections\n"); fprintf(stderr," -V, -v, --version Display version information and exit.\n"); + fprintf(stderr," -n, --name Specify a local hostname.\n"); } /* @@ -155,8 +157,11 @@ int main (int argc, char **argv) version_p = VERSION; } + /* Set hostname */ + MY_NAME = NULL; + /* Process command line switches */ - while ((arg = getopt_long(argc, argv, "h?vVFdp:o:", longopts, NULL)) != EOF) { + while ((arg = getopt_long(argc, argv, "h?vVFdn:p:o:", longopts, NULL)) != EOF) { switch (arg) { case 'V': /* Version */ case 'v': @@ -186,6 +191,9 @@ int main (int argc, char **argv) exit(1); } break; + case 'n': /* Specify local hostname */ + MY_NAME = xstrdup(optarg); + break; case '?': /* heeeeeelllllllpppp? heh */ case 'h': usage();