summaryrefslogtreecommitdiffstats
path: root/scd/scdaemon.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2018-03-13 04:05:57 +0100
committerNIIBE Yutaka <gniibe@fsij.org>2018-03-13 04:05:57 +0100
commit71e5282c25ba812c7091e587edd721839bc4c2ac (patch)
tree416f2b82f342e31aba152a08e07673da54960a64 /scd/scdaemon.c
parentscd: Fix typo in previous commit. (diff)
downloadgnupg2-71e5282c25ba812c7091e587edd721839bc4c2ac.tar.xz
gnupg2-71e5282c25ba812c7091e587edd721839bc4c2ac.zip
scd: Fix for GNU/Linux suspend/resume.
* configure.ac (require_pipe_to_unblock_pselect): Default is "yes". * scd/scdaemon.c (scd_kick_the_loop): Minor clean up. -- Normally SIGCONT or SIGUSR2 works for unblocking pselect. But on my machine with GNU/Linux, when a machine is suspend/resume-ed, pselect keeps blocked, while signal itself is delivered. It's better to use pipe. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'scd/scdaemon.c')
-rw-r--r--scd/scdaemon.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/scd/scdaemon.c b/scd/scdaemon.c
index 91b559925..e63aca72f 100644
--- a/scd/scdaemon.c
+++ b/scd/scdaemon.c
@@ -1206,18 +1206,16 @@ start_connection_thread (void *arg)
void
scd_kick_the_loop (void)
{
- int ret;
-
/* Kick the select loop. */
#ifdef HAVE_W32_SYSTEM
- ret = SetEvent (the_event);
+ int ret = SetEvent (the_event);
if (ret == 0)
log_error ("SetEvent for scd_kick_the_loop failed: %s\n",
w32_strerror (-1));
#elif defined(HAVE_PSELECT_NO_EINTR)
write (notify_fd, "", 1);
#else
- ret = kill (main_thread_pid, SIGCONT);
+ int ret = kill (main_thread_pid, SIGCONT);
if (ret < 0)
log_error ("SetEvent for scd_kick_the_loop failed: %s\n",
gpg_strerror (gpg_error_from_syserror ()));