Source-Changes-HG archive

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

[src/trunk]: src don't check the return value of execvp() for failure to call...



details:   https://anonhg.NetBSD.org/src/rev/22cb15eae427
branches:  trunk
changeset: 996436:22cb15eae427
user:      mrg <mrg%NetBSD.org@localhost>
date:      Fri Feb 01 09:06:07 2019 +0000

description:
don't check the return value of execvp() for failure to call err().
assume if it returns at all something has failed.

diffstat:

 tests/fs/common/fstest_nfs.c                 |  6 +++---
 tests/fs/common/fstest_puffs.c               |  6 +++---
 usr.sbin/puffs/rump_syspuffs/rump_syspuffs.c |  6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diffs (60 lines):

diff -r 7520bc0a0508 -r 22cb15eae427 tests/fs/common/fstest_nfs.c
--- a/tests/fs/common/fstest_nfs.c      Fri Feb 01 08:37:21 2019 +0000
+++ b/tests/fs/common/fstest_nfs.c      Fri Feb 01 09:06:07 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fstest_nfs.c,v 1.9 2011/02/28 21:08:46 pooka Exp $     */
+/*     $NetBSD: fstest_nfs.c,v 1.10 2019/02/01 09:06:07 mrg Exp $      */
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -113,8 +113,8 @@
                close(pipes[0]);
                if (dup2(pipes[1], 3) == -1)
                        err(1, "dup2");
-               if (execvp(nfsdargv[0], nfsdargv) == -1)
-                       err(1, "execvp");
+               execvp(nfsdargv[0], nfsdargv);
+               err(1, "execvp");
        case -1:
                return errno;
        default:
diff -r 7520bc0a0508 -r 22cb15eae427 tests/fs/common/fstest_puffs.c
--- a/tests/fs/common/fstest_puffs.c    Fri Feb 01 08:37:21 2019 +0000
+++ b/tests/fs/common/fstest_puffs.c    Fri Feb 01 09:06:07 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fstest_puffs.c,v 1.11 2013/09/09 19:47:38 pooka Exp $  */
+/*     $NetBSD: fstest_puffs.c,v 1.12 2019/02/01 09:06:07 mrg Exp $    */
 
 /*
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -277,8 +277,8 @@
                if (setenv("PUFFS_COMFD", comfd, 1) == -1)
                        return errno;
 
-               if (execvp(theargv[0], theargv) == -1)
-                       return errno;
+               execvp(theargv[0], theargv);
+               return errno;
        case -1:
                return errno;
        default:
diff -r 7520bc0a0508 -r 22cb15eae427 usr.sbin/puffs/rump_syspuffs/rump_syspuffs.c
--- a/usr.sbin/puffs/rump_syspuffs/rump_syspuffs.c      Fri Feb 01 08:37:21 2019 +0000
+++ b/usr.sbin/puffs/rump_syspuffs/rump_syspuffs.c      Fri Feb 01 09:06:07 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rump_syspuffs.c,v 1.12 2011/08/31 13:32:39 joerg Exp $ */
+/*     $NetBSD: rump_syspuffs.c,v 1.13 2019/02/01 09:06:07 mrg Exp $   */
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -113,8 +113,8 @@
                        err(1, "setenv");
 
                argv++;
-               if (execvp(argv[0], argv) == -1)
-                       err(1, "execvp");
+               (void)execvp(argv[0], argv);
+               err(1, "execvp");
                /*NOTREACHED*/
        case -1:
                err(1, "fork");



Home | Main Index | Thread Index | Old Index