Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/xinstall remove useless assignment and explain why.



details:   https://anonhg.NetBSD.org/src/rev/3d4715dcd637
branches:  trunk
changeset: 338958:3d4715dcd637
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Jun 19 17:17:24 2015 +0000

description:
remove useless assignment and explain why.

diffstat:

 usr.bin/xinstall/xinstall.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (42 lines):

diff -r 18e84e5c4792 -r 3d4715dcd637 usr.bin/xinstall/xinstall.c
--- a/usr.bin/xinstall/xinstall.c       Fri Jun 19 14:55:51 2015 +0000
+++ b/usr.bin/xinstall/xinstall.c       Fri Jun 19 17:17:24 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xinstall.c,v 1.122 2015/06/19 14:32:56 christos Exp $  */
+/*     $NetBSD: xinstall.c,v 1.123 2015/06/19 17:17:24 christos Exp $  */
 
 /*
  * Copyright (c) 1987, 1993
@@ -46,7 +46,7 @@
 #if 0
 static char sccsid[] = "@(#)xinstall.c 8.1 (Berkeley) 7/21/93";
 #else
-__RCSID("$NetBSD: xinstall.c,v 1.122 2015/06/19 14:32:56 christos Exp $");
+__RCSID("$NetBSD: xinstall.c,v 1.123 2015/06/19 17:17:24 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -1001,10 +1001,12 @@
                rv = posix_spawn(NULL, command, NULL, NULL, args, NULL);
        else
                rv = posix_spawnp(NULL, command, NULL, NULL, args, NULL);
-       if (rv != 0) {
+       if (rv != 0)
                warnc(rv, "Cannot execute %s", command);
-               rv = -1;
-       }
+       /*
+        * the wait below will fail if we did not create a child it will
+        * make rv negative.
+        */
 #else
        switch (vfork()) {
        case -1:
@@ -1036,6 +1038,7 @@
        }
 #endif
        rv = wait(&status);
+out1:
        if (cmd != to_name)
                free(cmd);
 out:



Home | Main Index | Thread Index | Old Index