diff options
author | dim <dim@FreeBSD.org> | 2012-02-06 21:35:11 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-02-06 21:35:11 +0000 |
commit | 770ca66a70c24c7ea6a390600190f6d2da11ee57 (patch) | |
tree | d2b58fe04c65a0fa2508f87890d925f21819d8a3 | |
parent | 021c66f70f01c3bec51cbc8897f52d79fc09569b (diff) | |
download | FreeBSD-src-770ca66a70c24c7ea6a390600190f6d2da11ee57.zip FreeBSD-src-770ca66a70c24c7ea6a390600190f6d2da11ee57.tar.gz |
In usr.bin/rpcgen/rpc_main.c, use execvp(3) instead of execv(3), so
rpcgen will search the current PATH for the preprocessor. This makes it
possible to run a preprocessor built during the cross-tools stage of
buildworld.
MFC after: 1 week
-rw-r--r-- | usr.bin/rpcgen/rpc_main.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/usr.bin/rpcgen/rpc_main.c b/usr.bin/rpcgen/rpc_main.c index 7cff9bf..a54c3e9 100644 --- a/usr.bin/rpcgen/rpc_main.c +++ b/usr.bin/rpcgen/rpc_main.c @@ -290,7 +290,6 @@ prepend_cpp(void) int idx = 1; const char *var; char *dupvar, *s, *t; - struct stat buf; if (CPP != NULL) insarg(0, CPP); @@ -306,11 +305,6 @@ prepend_cpp(void) free(dupvar); } - if (stat(arglist[0], &buf) < 0) { - warnx("cannot find C preprocessor: %s", arglist[0]); - crash(); - } - insarg(idx, CPPFLAGS); } @@ -334,8 +328,8 @@ open_input(const char *infile, const char *define) (void) close(1); (void) dup2(pd[1], 1); (void) close(pd[0]); - execv(arglist[0], arglist); - err(1, "execv"); + execvp(arglist[0], arglist); + err(1, "execvp %s", arglist[0]); case -1: err(1, "fork"); } |