Fix possible _SC_OPEN_MAX max problem on AIX.
* src/posix-io.c [HAVE_STDINT_H]: Include stdint.h. (get_max_fds): Limit returned value for too high values. -- Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
83415dffae
commit
e79199468a
@ -23,6 +23,9 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#ifdef HAVE_STDINT_H
|
||||||
|
# include <stdint.h>
|
||||||
|
#endif
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@ -331,6 +334,16 @@ get_max_fds (void)
|
|||||||
fds = 1024;
|
fds = 1024;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* AIX returns INT32_MAX instead of a proper value. We assume that
|
||||||
|
* this is always an error and use a more reasonable limit. */
|
||||||
|
#ifdef INT32_MAX
|
||||||
|
if (fds == INT32_MAX)
|
||||||
|
{
|
||||||
|
source = "aix-fix";
|
||||||
|
fds = 1024;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
TRACE2 (DEBUG_SYSIO, "gpgme:max_fds", 0, "max fds=%i (%s)", fds, source);
|
TRACE2 (DEBUG_SYSIO, "gpgme:max_fds", 0, "max fds=%i (%s)", fds, source);
|
||||||
return fds;
|
return fds;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user