X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fnfsd%2Fnfsd.c;h=86e809499236c8a4bf3e3bf3c213d91dbcbdf4a1;hp=772f72df54693751550eac1c9fbe978d427720b9;hb=87fe487c6f5abe9f40f2f036c3cf6c7f02fa0385;hpb=ac84b80afc13d5a96813e678ad5c86c6036f022e diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c index 772f72d..86e8094 100644 --- a/utils/nfsd/nfsd.c +++ b/utils/nfsd/nfsd.c @@ -17,6 +17,7 @@ #include #include #include +#include #include "nfslib.h" static void usage(const char *); @@ -25,10 +26,13 @@ int main(int argc, char **argv) { int count = 1, c, error, port, fd; + struct servent *ent; - port = 2049; - - /* FIXME: Check for nfs in /etc/services */ + ent = getservbyname ("nfs", "udp"); + if (ent != NULL) + port = ntohs (ent->s_port); + else + port = 2049; while ((c = getopt(argc, argv, "hp:P:")) != EOF) { switch(c) {