summaryrefslogtreecommitdiffstats
path: root/utils/mountd/mountd.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils/mountd/mountd.c')
-rw-r--r--utils/mountd/mountd.c25
1 files changed, 13 insertions, 12 deletions
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"); */