diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2020-03-17 12:33:47 +0000 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2020-03-17 20:09:25 +0000 |
commit | c85879f8174a658ddac9524d078b2a717f964710 (patch) | |
tree | d398977b0aaf93ee0f17c36bfc2a19ca22ab272c | |
parent | 130212d30d47e588c2bc03edcfce11bf3857da03 (diff) |
Avoid corrupting globals during time-pauses
-rw-r--r-- | src/src/exim.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/src/exim.c b/src/src/exim.c index 4e4b6bb75..5e2f43799 100644 --- a/src/src/exim.c +++ b/src/src/exim.c @@ -309,6 +309,7 @@ milliwait(struct itimerval *itval) { sigset_t sigmask; sigset_t old_sigmask; +int save_errno = errno; if (itval->it_value.tv_usec < 50 && itval->it_value.tv_sec == 0) return; @@ -322,6 +323,8 @@ if (setitimer(ITIMER_REAL, itval, NULL) < 0) /* Start timer */ (void)sigdelset(&sigmask, SIGALRM); /* Remove SIGALRM */ (void)sigsuspend(&sigmask); /* Until SIGALRM */ (void)sigprocmask(SIG_SETMASK, &old_sigmask, NULL); /* Restore mask */ +errno = save_errno; +sigalrm_seen = FALSE; } |