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>
This commit is contained in:
Werner Koch 2015-05-11 20:18:08 +02:00
parent 26e2eb98d3
commit 987532b038
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
1 changed files with 10 additions and 0 deletions

View File

@ -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;
}