From c276b8a8c2a5181558b976b9cb1d60a0180d560e Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 10 Oct 2018 05:26:02 -0500 Subject: Add xsignal_flags() and more consistently use xsignal() instead of signal(). xsignal() wraps sigaction() giving control of SA_RESTART behavior and such. --- lib/password.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/password.c') diff --git a/lib/password.c b/lib/password.c index a02bc542..b9cc1346 100644 --- a/lib/password.c +++ b/lib/password.c @@ -53,7 +53,8 @@ int read_password(char *buf, int buflen, char *mesg) struct sigaction sa, oldsa; int i, ret = 1; - // NOP signal handler to return from the read + // NOP signal handler to return from the read. Use sigaction() instead + // of xsignal() because we want to restore the old handler afterwards. memset(&sa, 0, sizeof(sa)); sa.sa_handler = generic_signal; sigaction(SIGINT, &sa, &oldsa); -- cgit v1.2.3