Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/pkg_install Replace a few calls to vsystem() with c...



details:   https://anonhg.NetBSD.org/src/rev/6625baec6458
branches:  trunk
changeset: 550904:6625baec6458
user:      tron <tron%NetBSD.org@localhost>
date:      Sun Aug 24 21:11:37 2003 +0000

description:
Replace a few calls to vsystem() with calls to fexec() to speed up
operations.

diffstat:

 usr.sbin/pkg_install/add/futil.c   |  6 +++---
 usr.sbin/pkg_install/add/perform.c |  6 +++---
 usr.sbin/pkg_install/lib/pen.c     |  6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diffs (78 lines):

diff -r 1291ddb7cde3 -r 6625baec6458 usr.sbin/pkg_install/add/futil.c
--- a/usr.sbin/pkg_install/add/futil.c  Sun Aug 24 21:10:47 2003 +0000
+++ b/usr.sbin/pkg_install/add/futil.c  Sun Aug 24 21:11:37 2003 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: futil.c,v 1.9 2002/10/17 03:31:33 christos Exp $       */
+/*     $NetBSD: futil.c,v 1.10 2003/08/24 21:11:37 tron Exp $  */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static const char *rcsid = "from FreeBSD Id: futil.c,v 1.7 1997/10/08 07:45:39 charnier Exp";
 #else
-__RCSID("$NetBSD: futil.c,v 1.9 2002/10/17 03:31:33 christos Exp $");
+__RCSID("$NetBSD: futil.c,v 1.10 2003/08/24 21:11:37 tron Exp $");
 #endif
 #endif
 
@@ -53,7 +53,7 @@
                        if (!(isdir(dir) || islinktodir(dir)))
                                return FAIL;
                } else {
-                       if (vsystem("mkdir %s", dir))
+                       if (fexec("mkdir", dir, NULL))
                                return FAIL;
                        apply_perms(NULL, dir);
                }
diff -r 1291ddb7cde3 -r 6625baec6458 usr.sbin/pkg_install/add/perform.c
--- a/usr.sbin/pkg_install/add/perform.c        Sun Aug 24 21:10:47 2003 +0000
+++ b/usr.sbin/pkg_install/add/perform.c        Sun Aug 24 21:11:37 2003 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: perform.c,v 1.83 2003/07/14 06:00:44 itojun Exp $      */
+/*     $NetBSD: perform.c,v 1.84 2003/08/24 21:11:37 tron Exp $        */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.44 1997/10/13 15:03:46 jkh Exp";
 #else
-__RCSID("$NetBSD: perform.c,v 1.83 2003/07/14 06:00:44 itojun Exp $");
+__RCSID("$NetBSD: perform.c,v 1.84 2003/08/24 21:11:37 tron Exp $");
 #endif
 #endif
 
@@ -572,7 +572,7 @@
 
        /* Look for the requirements file */
        if (fexists(REQUIRE_FNAME)) {
-               vsystem("%s +x %s", CHMOD_CMD, REQUIRE_FNAME);  /* be sure */
+               (void) fexec(CHMOD_CMD, "+x", REQUIRE_FNAME, NULL);     /* be sure */
                if (Verbose)
                        printf("Running requirements file first for %s.\n", PkgName);
                if (!Fake && vsystem("./%s %s INSTALL", REQUIRE_FNAME, PkgName)) {
diff -r 1291ddb7cde3 -r 6625baec6458 usr.sbin/pkg_install/lib/pen.c
--- a/usr.sbin/pkg_install/lib/pen.c    Sun Aug 24 21:10:47 2003 +0000
+++ b/usr.sbin/pkg_install/lib/pen.c    Sun Aug 24 21:11:37 2003 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: pen.c,v 1.27 2003/07/14 06:17:56 itojun Exp $  */
+/*     $NetBSD: pen.c,v 1.28 2003/08/24 21:11:39 tron Exp $    */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static const char *rcsid = "from FreeBSD Id: pen.c,v 1.25 1997/10/08 07:48:12 charnier Exp";
 #else
-__RCSID("$NetBSD: pen.c,v 1.27 2003/07/14 06:17:56 itojun Exp $");
+__RCSID("$NetBSD: pen.c,v 1.28 2003/08/24 21:11:39 tron Exp $");
 #endif
 #endif
 
@@ -185,7 +185,7 @@
                        fprintf(stderr, "PANIC: About to rm -rf / (not doing so, aborting)\n");
                        abort();
                }
-               if (vsystem("rm -rf %s", Current))
+               if (fexec("rm", "-rf", Current, NULL))
                        warnx("couldn't remove temporary dir '%s'", Current);
                strlcpy(Current, Previous, sizeof(Current));
        }



Home | Main Index | Thread Index | Old Index