chiark / gitweb /
locking.c: Reset alarm state before invoking the target command.
[misc] / locking.c
index f486ea4302b30aaf7538b876c572471182332b05..8931dbd7dc5d382e0514452232eac703b8c177e2 100644 (file)
--- 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);