From 9e5dc17c1d08336ec3616556aedecd68767f8575 Mon Sep 17 00:00:00 2001 From: steve Date: Thu, 11 Oct 2001 00:12:49 +0000 Subject: [PATCH] Detect execv failures. --- driver/main.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/driver/main.c b/driver/main.c index 3b3505008..1ad0b4576 100644 --- a/driver/main.c +++ b/driver/main.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#ident "$Id: main.c,v 1.21 2001/07/25 03:10:50 steve Exp $" +#ident "$Id: main.c,v 1.22 2001/10/11 00:12:49 steve Exp $" # include "config.h" @@ -147,6 +147,11 @@ static int t_default(char*cmd, unsigned ncmd) rc = system(cmd); if (rc != 0) { + if (rc == 127) { + fprintf(stderr, "Failed to execute: %s\n", cmd); + return 1; + } + if (WIFEXITED(rc)) return WEXITSTATUS(rc); @@ -639,6 +644,9 @@ int main(int argc, char **argv) /* * $Log: main.c,v $ + * Revision 1.22 2001/10/11 00:12:49 steve + * Detect execv failures. + * * Revision 1.21 2001/07/25 03:10:50 steve * Create a config.h.in file to hold all the config * junk, and support gcc 3.0. (Stephan Boettcher)