From 11387b24a5de76b2dff1a142c9a897519d5bf24d Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 24 Sep 2024 15:26:58 +0200 Subject: common: Add debug code to gnupg_exec_tool_stream * common/exectool.c (gnupg_exec_tool_stream): Add diagnostic. -- This should help if something is broken with poll. --- common/exectool.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'common') diff --git a/common/exectool.c b/common/exectool.c index de460084f..900020ecc 100644 --- a/common/exectool.c +++ b/common/exectool.c @@ -484,6 +484,13 @@ gnupg_exec_tool_stream (const char *pgmname, const char *argv[], log_debug ("unexpected timeout while polling '%s'\n", pgmname); break; } + for (i=0; i < 4; i++) + if (!fds[i].ignore && fds[i].got_nval) + { + /* This should never happen. */ + log_debug ("closed fd passed to poll at idx %d - ignored\n", i); + fds[i].ignore = 1; + } if (fds[0].got_write) { -- cgit v1.2.3