summaryrefslogtreecommitdiffstats
path: root/login-utils/ttymsg.c
diff options
context:
space:
mode:
Diffstat (limited to 'login-utils/ttymsg.c')
-rw-r--r--login-utils/ttymsg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/login-utils/ttymsg.c b/login-utils/ttymsg.c
index 0dbe58113..24b74bcbc 100644
--- a/login-utils/ttymsg.c
+++ b/login-utils/ttymsg.c
@@ -128,6 +128,7 @@ ttymsg(struct iovec *iov, int iovcnt, char *line, int tmout) {
}
if (errno == EWOULDBLOCK) {
int cpid, flags;
+ sigset_t sigmask;
if (forked) {
(void) close(fd);
@@ -153,7 +154,8 @@ ttymsg(struct iovec *iov, int iovcnt, char *line, int tmout) {
/* wait at most tmout seconds */
(void) signal(SIGALRM, SIG_DFL);
(void) signal(SIGTERM, SIG_DFL); /* XXX */
- (void) sigsetmask(0);
+ sigemptyset(&sigmask);
+ sigprocmask (SIG_SETMASK, &sigmask, NULL);
(void) alarm((u_int)tmout);
flags = fcntl(fd, F_GETFL);
fcntl(flags, F_SETFL, (long) (flags & ~O_NONBLOCK));