Source-Changes-HG archive

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

[src/trunk]: src/bin/mv the case of waitpid() returning an error was already ...



details:   https://anonhg.NetBSD.org/src/rev/d361ec828994
branches:  trunk
changeset: 581654:d361ec828994
user:      hubertf <hubertf%NetBSD.org@localhost>
date:      Fri Jun 03 13:55:04 2005 +0000

description:
the case of waitpid() returning an error was already tested, and errno
printed for that case. the tests for the return code don't have errno
set, so don't try to print it.

By Liam J. Foy <liamfoy sepulcrum.org>, posted to tech-userlevel@.

diffstat:

 bin/mv/mv.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (46 lines):

diff -r 960267719de6 -r d361ec828994 bin/mv/mv.c
--- a/bin/mv/mv.c       Fri Jun 03 13:48:38 2005 +0000
+++ b/bin/mv/mv.c       Fri Jun 03 13:55:04 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mv.c,v 1.34 2004/01/04 16:04:18 jschauma Exp $ */
+/* $NetBSD: mv.c,v 1.35 2005/06/03 13:55:04 hubertf Exp $ */
 
 /*
  * Copyright (c) 1989, 1993, 1994
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)mv.c       8.2 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: mv.c,v 1.34 2004/01/04 16:04:18 jschauma Exp $");
+__RCSID("$NetBSD: mv.c,v 1.35 2005/06/03 13:55:04 hubertf Exp $");
 #endif
 #endif /* not lint */
 
@@ -338,11 +338,11 @@
                return (1);
        }
        if (!WIFEXITED(status)) {
-               warn("%s: did not terminate normally", _PATH_CP);
+               warnx("%s: did not terminate normally", _PATH_CP);
                return (1);
        }
        if (WEXITSTATUS(status)) {
-               warn("%s: terminated with %d (non-zero) status",
+               warnx("%s: terminated with %d (non-zero) status",
                    _PATH_CP, WEXITSTATUS(status));
                return (1);
        }
@@ -356,11 +356,11 @@
                return (1);
        }
        if (!WIFEXITED(status)) {
-               warn("%s: did not terminate normally", _PATH_RM);
+               warnx("%s: did not terminate normally", _PATH_RM);
                return (1);
        }
        if (WEXITSTATUS(status)) {
-               warn("%s: terminated with %d (non-zero) status",
+               warnx("%s: terminated with %d (non-zero) status",
                    _PATH_RM, WEXITSTATUS(status));
                return (1);
        }



Home | Main Index | Thread Index | Old Index