From: Mark Wooding Date: Mon, 31 May 2010 17:01:56 +0000 (+0100) Subject: locking.c: Reset alarm state before invoking the target command. X-Git-Tag: 1.2.4~3 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/misc/commitdiff_plain/76e174aab98dfc93d396e134296b1c780ad1673d locking.c: Reset alarm state before invoking the target command. There's nothing worse than grabbing a lock, trying to do something, and then being killed by an alarm clock midway through. Well, there are probably are worse things, but this commit message isn't the right place to list them. --- diff --git a/locking.c b/locking.c index f486ea4..8931dbd 100644 --- a/locking.c +++ b/locking.c @@ -224,7 +224,9 @@ doneopts: errno = 0; } signal(SIGALRM, oalrm); - if (ot) { + if (!ot) + alarm(0); + else { nt = time(0) - nt; if (nt > ot) raise(SIGALRM);