diff options
author | 1999-12-16 17:31:51 +0000 | |
---|---|---|
committer | 1999-12-16 17:31:51 +0000 | |
commit | ad005d4eebf0bd231a79b61bc4195bbefca8014a (patch) | |
tree | 715414877c80d1d6d1e8cd8a8837386f117411d1 | |
parent | Var_Subst is actually two distinct functions folded into one: (diff) | |
download | wireguard-openbsd-ad005d4eebf0bd231a79b61bc4195bbefca8014a.tar.xz wireguard-openbsd-ad005d4eebf0bd231a79b61bc4195bbefca8014a.zip |
Bugfix: execvp might fail for many reasons.
Perform an explicit ENOENT check to keep the same error message
for known cases.
-rw-r--r-- | usr.bin/make/compat.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c index 162549c8940..a714ef355c5 100644 --- a/usr.bin/make/compat.c +++ b/usr.bin/make/compat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: compat.c,v 1.16 1999/12/16 17:27:18 espie Exp $ */ +/* $OpenBSD: compat.c,v 1.17 1999/12/16 17:31:51 espie Exp $ */ /* $NetBSD: compat.c,v 1.14 1996/11/06 17:59:01 christos Exp $ */ /* @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94"; #else -static char rcsid[] = "$OpenBSD: compat.c,v 1.16 1999/12/16 17:27:18 espie Exp $"; +static char rcsid[] = "$OpenBSD: compat.c,v 1.17 1999/12/16 17:31:51 espie Exp $"; #endif #endif /* not lint */ @@ -350,8 +350,10 @@ CompatRunCommand (cmdp, gnp) if (cpid == 0) { if (local) { execvp(av[0], av); - (void) write (2, av[0], strlen (av[0])); - (void) write (2, ": not found\n", sizeof(": not found")); + if (errno == ENOENT) + fprintf(stderr, "%s: not found\n", av[0]); + else + perror(av[0]); } else { (void)execv(av[0], av); } |