From 987532b038a2d9b9e76c0de425ee036ca2bffa1b Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 11 May 2015 20:18:08 +0200 Subject: [PATCH] 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 --- common/exechelp-posix.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 #include +#ifdef HAVE_STDINT_H +# include +#endif #include #include #include @@ -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; }