core: Use better error code when using select with a too high fd.
authorWerner Koch <wk@gnupg.org>
Thu, 10 Nov 2016 18:49:13 +0000 (19:49 +0100)
committerWerner Koch <wk@gnupg.org>
Thu, 10 Nov 2016 18:49:58 +0000 (19:49 +0100)
commit6e57379c8e37c0863f7d12819a5a7d0781bd76d2
treeea1856b8e7fdd4bcb6cafc7b46f0e1daf1935fe9
parentddd0a3cf90ac4b0a27ea610ebd7b9b8016ff43c4
core: Use better error code when using select with a too high fd.

* src/posix-io.c (_gpgme_io_select): Return EMFILE instead of EBADF.
--

Also EBADF seem more correct, EMFILE (Too man open files) gives
a clearer message to the user that there are somehow too many files
open.  The problem can be exhibited by running lots of threads,

We should eventually move to poll but that would be a large change and
so we better fix it with the planned migration of the I/O subsystem to
libgpgrt (currently known as libgpg-error).

Signed-off-by: Werner Koch <wk@gnupg.org>
src/posix-io.c