mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
commond: Introduce FD2NUM to express conversion to number of fds.
* common/sysutils.h (FD2NUM): New. * agent/call-pinentry.c (watch_sock): Use FD2NUM. * agent/gpg-agent.c (handle_connections): Likewise. * dirmngr/dirmngr.c (handle_connections): Likewise. * dirmngr/http.c (connect_with_timeout): Likewise. * kbx/keyboxd.c (handle_connections): Likewise. * scd/scdaemon.c (handle_connections): Likewise. * tpm2d/tpm2daemon.c (handle_connections): Likewise. -- GnuPG-bug-id: 6598 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
521ec40aea
commit
ea1935252e
8 changed files with 12 additions and 10 deletions
|
@ -1302,7 +1302,7 @@ watch_sock (void *arg)
|
|||
|
||||
FD_ZERO (&fdset);
|
||||
FD_SET (FD2INT (sock), &fdset);
|
||||
err = npth_select (FD2INT (sock)+1, &fdset, NULL, NULL, &timeout);
|
||||
err = npth_select (FD2NUM (sock)+1, &fdset, NULL, NULL, &timeout);
|
||||
|
||||
if (err < 0)
|
||||
{
|
||||
|
|
|
@ -3070,24 +3070,24 @@ handle_connections (gnupg_fd_t listen_fd,
|
|||
|
||||
FD_ZERO (&fdset);
|
||||
FD_SET (FD2INT (listen_fd), &fdset);
|
||||
nfd = FD2INT (listen_fd);
|
||||
nfd = FD2NUM (listen_fd);
|
||||
if (listen_fd_extra != GNUPG_INVALID_FD)
|
||||
{
|
||||
FD_SET ( FD2INT(listen_fd_extra), &fdset);
|
||||
if (FD2INT (listen_fd_extra) > nfd)
|
||||
nfd = FD2INT (listen_fd_extra);
|
||||
nfd = FD2NUM (listen_fd_extra);
|
||||
}
|
||||
if (listen_fd_browser != GNUPG_INVALID_FD)
|
||||
{
|
||||
FD_SET ( FD2INT(listen_fd_browser), &fdset);
|
||||
if (FD2INT (listen_fd_browser) > nfd)
|
||||
nfd = FD2INT (listen_fd_browser);
|
||||
nfd = FD2NUM (listen_fd_browser);
|
||||
}
|
||||
if (listen_fd_ssh != GNUPG_INVALID_FD)
|
||||
{
|
||||
FD_SET ( FD2INT(listen_fd_ssh), &fdset);
|
||||
if (FD2INT (listen_fd_ssh) > nfd)
|
||||
nfd = FD2INT (listen_fd_ssh);
|
||||
nfd = FD2NUM (listen_fd_ssh);
|
||||
}
|
||||
if (sock_inotify_fd != -1)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue