diff options
author | Werner Koch <wk@gnupg.org> | 2015-05-11 20:18:08 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2015-05-11 20:22:32 +0200 |
commit | 987532b038a2d9b9e76c0de425ee036ca2bffa1b (patch) | |
tree | 05ae619c5d1e3299742f7a9a1f2e2f0a927f1a3e | |
parent | gpg-connect-agent: Fix quoting of internal percent+ function. (diff) | |
download | gnupg2-987532b038a2d9b9e76c0de425ee036ca2bffa1b.tar.xz gnupg2-987532b038a2d9b9e76c0de425ee036ca2bffa1b.zip |
common: Cope with AIX problem on number of open files.
* common/exechelp-posix.c: Limit returned value for too hight values.
--
GnuPG-bug-id: 1778
Signed-off-by: Werner Koch <wk@gnupg.org>
-rw-r--r-- | common/exechelp-posix.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/common/exechelp-posix.c b/common/exechelp-posix.c index 1a1ff1bb2..8a2b3b9c2 100644 --- a/common/exechelp-posix.c +++ b/common/exechelp-posix.c @@ -36,6 +36,9 @@ #include <stdio.h> #include <stdlib.h> +#ifdef HAVE_STDINT_H +# include <stdint.h> +#endif #include <string.h> #include <errno.h> #include <assert.h> @@ -114,6 +117,13 @@ get_max_fds (void) if (max_fds == -1) max_fds = 256; /* Arbitrary limit. */ + /* AIX returns INT32_MAX instead of a proper value. We assume that + this is always an error and use an arbitrary limit. */ +#ifdef INT32_MAX + if (max_fds == INT32_MAX) + max_fds = 256; +#endif + return max_fds; } |