aboutsummaryrefslogtreecommitdiffstats
path: root/common/sysutils.h
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2023-07-18 05:43:36 +0000
committerNIIBE Yutaka <[email protected]>2023-07-18 05:43:36 +0000
commitea1935252e287b63f04c6d460cfb85e4e5efe379 (patch)
tree926cd14224f7058027cebe985f354868f66f8969 /common/sysutils.h
parentcommon,w32: Fix FD2INT macro. (diff)
downloadgnupg-ea1935252e287b63f04c6d460cfb85e4e5efe379.tar.gz
gnupg-ea1935252e287b63f04c6d460cfb85e4e5efe379.zip
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 <[email protected]>
Diffstat (limited to 'common/sysutils.h')
-rw-r--r--common/sysutils.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/sysutils.h b/common/sysutils.h
index e34fff72f..dac2d9244 100644
--- a/common/sysutils.h
+++ b/common/sysutils.h
@@ -44,12 +44,14 @@ typedef void *gnupg_fd_t;
# define FD2INT(h) ((unsigned int)(h))
# endif
#define FD_DBG(h) ((int)(intptr_t)(h))
+#define FD2NUM(h) ((int)(intptr_t)(h))
#else
typedef int gnupg_fd_t;
#define GNUPG_INVALID_FD (-1)
#define INT2FD(s) (s)
#define FD2INT(h) (h)
#define FD_DBG(h) (h)
+#define FD2NUM(h) (h)
#endif
#ifdef HAVE_STAT