summaryrefslogtreecommitdiffstats
path: root/utils/nfsd/nfsd.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils/nfsd/nfsd.c')
-rw-r--r--utils/nfsd/nfsd.c10
1 files changed, 7 insertions, 3 deletions
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 <errno.h>
#include <getopt.h>
#include <syslog.h>
+#include <netdb.h>
#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) {