From bce6f6871f481087890674497b4b2154dc4825fc Mon Sep 17 00:00:00 2001 From: neilbrown Date: Thu, 17 Jul 2003 23:41:19 +0000 Subject: Release 1.0.5 --- utils/mountd/mountd.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'utils/mountd/mountd.c') diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c index ae5daa1..d0d8103 100644 --- a/utils/mountd/mountd.c +++ b/utils/mountd/mountd.c @@ -431,7 +431,7 @@ main(int argc, char **argv) char *export_file = _PATH_EXPORTS; int foreground = 0; int port = 0; - int descriptors = 256; + int descriptors = 0; int c; struct sigaction sa; struct rlimit rlim; @@ -498,19 +498,20 @@ main(int argc, char **argv) exit(1); } - if (getrlimit (RLIMIT_NOFILE, &rlim) != 0) { - fprintf(stderr, "%s: getrlimit (RLIMIT_NOFILE) failed: %s\n", - argv [0], strerror(errno)); - exit(1); - } + if (descriptors) { + if (getrlimit (RLIMIT_NOFILE, &rlim) != 0) { + fprintf(stderr, "%s: getrlimit (RLIMIT_NOFILE) failed: %s\n", + argv [0], strerror(errno)); + exit(1); + } - rlim.rlim_cur = descriptors; - if (setrlimit (RLIMIT_NOFILE, &rlim) != 0) { - fprintf(stderr, "%s: setrlimit (RLIMIT_NOFILE) failed: %s\n", - argv [0], strerror(errno)); - exit(1); + rlim.rlim_cur = descriptors; + if (setrlimit (RLIMIT_NOFILE, &rlim) != 0) { + fprintf(stderr, "%s: setrlimit (RLIMIT_NOFILE) failed: %s\n", + argv [0], strerror(errno)); + exit(1); + } } - /* Initialize logging. */ /* xlog_open("mountd"); */ -- cgit