diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-02-15 16:37:53 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-02-15 16:37:53 -0500 |
commit | e6e929f5cf5d548d64c4400c0a5036d16b8c4046 (patch) | |
tree | 568ec21afdb5f5ee8912f1d7c5a49b6747409b5b /src | |
parent | 73182e322022611f8593af7b7ea141b96e8692ea (diff) | |
parent | da6720e9fa6e86e381cb82dd06bca73e7bc8bc6c (diff) | |
download | tor-e6e929f5cf5d548d64c4400c0a5036d16b8c4046.tar tor-e6e929f5cf5d548d64c4400c0a5036d16b8c4046.tar.gz |
Merge remote-tracking branch 'public/bug8209'
Diffstat (limited to 'src')
-rw-r--r-- | src/common/util.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/common/util.c b/src/common/util.c index 49353a8ee..6a6963559 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -3834,12 +3834,13 @@ tor_spawn_background(const char *const filename, const char **argv, child_state = CHILD_STATE_MAXFD; #ifdef _SC_OPEN_MAX - if (-1 != max_fd) { + if (-1 == max_fd) { max_fd = (int) sysconf(_SC_OPEN_MAX); - if (max_fd == -1) + if (max_fd == -1) { max_fd = DEFAULT_MAX_FD; log_warn(LD_GENERAL, "Cannot find maximum file descriptor, assuming %d", max_fd); + } } #else max_fd = DEFAULT_MAX_FD; |