Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/progress Test errno when the return value from wait(...



details:   https://anonhg.NetBSD.org/src/rev/bf2b234329a0
branches:  trunk
changeset: 985147:bf2b234329a0
user:      gson <gson%NetBSD.org@localhost>
date:      Mon Aug 09 10:46:39 2021 +0000

description:
Test errno when the return value from wait() indicates an error, not
when it indicates success.  PR install/56303.

diffstat:

 usr.bin/progress/progress.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 0ce39f2aaea8 -r bf2b234329a0 usr.bin/progress/progress.c
--- a/usr.bin/progress/progress.c       Mon Aug 09 04:06:21 2021 +0000
+++ b/usr.bin/progress/progress.c       Mon Aug 09 10:46:39 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: progress.c,v 1.23 2021/01/07 12:02:52 lukem Exp $ */
+/*     $NetBSD: progress.c,v 1.24 2021/08/09 10:46:39 gson Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: progress.c,v 1.23 2021/01/07 12:02:52 lukem Exp $");
+__RCSID("$NetBSD: progress.c,v 1.24 2021/08/09 10:46:39 gson Exp $");
 #endif                         /* not lint */
 
 #include <sys/types.h>
@@ -259,7 +259,7 @@
                 */
                ws = WIFSIGNALED(ws) ? WTERMSIG(ws) : WEXITSTATUS(ws);
 
-               if (deadpid != -1 && errno == EINTR)
+               if (deadpid == -1 && errno == EINTR)
                        continue;
                if (deadpid == pid) {
                        pid = 0;



Home | Main Index | Thread Index | Old Index