bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Add missing check for HAVE_POSIX_SIGNALS


From: Tom Tromey
Subject: Add missing check for HAVE_POSIX_SIGNALS
Date: Sat, 23 Jan 2021 10:11:13 -0700

While working to import Readline 8.1 into GDB, I found a bug that can
easily be reproduced with a mingw build on Linux.

Configure with --host=i686-w64-mingw32.
You'll have to install various mingw tools first; this is easily done on
Fedora though as they are all packaged there.

Make fails:

../master/signals.c: In function '_rl_handle_signal':
../master/signals.c:270:2: warning: implicit declaration of function 
'sigprocmask' [-Wimplicit-function-declaration]
  270 |  sigprocmask (SIG_BLOCK, &set, &oset);
      |  ^~~~~~~~~~~
../master/signals.c:270:15: error: 'SIG_BLOCK' undeclared (first use in this 
function); did you mean 'SIG_ACK'?
  270 |  sigprocmask (SIG_BLOCK, &set, &oset);
      |               ^~~~~~~~~
      |               SIG_ACK
[...]


The appended patch seems to fix the problem.

Tom

diff --git a/signals.c b/signals.c
index f9174ab..8fedc37 100644
--- a/signals.c
+++ b/signals.c
@@ -266,8 +266,10 @@ _rl_handle_signal (int sig)
     case SIGQUIT:
 #endif
 
+#if defined (HAVE_POSIX_SIGNALS)
       if (block_sig)
        sigprocmask (SIG_BLOCK, &set, &oset);
+#endif
 
       rl_echo_signal_char (sig);
       rl_cleanup_after_signal ();



reply via email to

[Prev in Thread] Current Thread [Next in Thread]