]> git.cameronkatri.com Git - bsd-progress.git/commitdiff
Turn off the alarmtimer before resetting the SIGALRM handler back to SIG_DFL.
authorlukem <lukem@NetBSD.org>
Mon, 21 Jan 2008 10:31:28 +0000 (10:31 +0000)
committerlukem <lukem@NetBSD.org>
Mon, 21 Jan 2008 10:31:28 +0000 (10:31 +0000)
Fix from dieter roelants <dieter.NetBSD@pandora.be>
Should fix PR 35630.

progressbar.c

index b9345cfadd9e85e914251b21cfc62ac4547a91d2..3f7e8df883d68a7828c608b9661f7c0c2b95cbff 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: progressbar.c,v 1.17 2007/05/05 18:09:24 martin Exp $  */
+/*     $NetBSD: progressbar.c,v 1.18 2008/01/21 10:31:28 lukem Exp $   */
 
 /*-
  * Copyright (c) 1997-2007 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: progressbar.c,v 1.17 2007/05/05 18:09:24 martin Exp $");
+__RCSID("$NetBSD: progressbar.c,v 1.18 2008/01/21 10:31:28 lukem Exp $");
 #endif /* not lint */
 
 /*
@@ -180,8 +180,8 @@ progressmeter(int flag)
                            "transfer aborted because stalled for %lu sec.\r\n",
                            getprogname(), (unsigned long)wait.tv_sec);
                        (void)write(fileno(ttyout), buf, len);
-                       (void)xsignal(SIGALRM, SIG_DFL);
                        alarmtimer(0);
+                       (void)xsignal(SIGALRM, SIG_DFL);
                        siglongjmp(toplevel, 1);
                }
 #endif /* !STANDALONE_PROGRESS */
@@ -198,8 +198,8 @@ progressmeter(int flag)
                        (void)xsignal_restart(SIGALRM, updateprogressmeter, 1);
                        alarmtimer(1);          /* set alarm timer for 1 Hz */
                } else if (flag == 1) {
-                       (void)xsignal(SIGALRM, SIG_DFL);
                        alarmtimer(0);
+                       (void)xsignal(SIGALRM, SIG_DFL);
                }
        }
 #ifndef NO_PROGRESS