aboutsummaryrefslogtreecommitdiff
path: root/lib/password.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/password.c')
-rw-r--r--lib/password.c3
1 files changed, 2 insertions, 1 deletions
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);