From 2b876972d066b862720551f83ca8b08be847b6ce Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Wed, 20 Jun 2007 18:54:21 +0000 Subject: [PATCH] * linux-low.c (linux_create_inferior): Try execv before execvp. * spu-low.c (spu_create_inferior): Likewise. --- gdb/gdbserver/ChangeLog | 5 +++++ gdb/gdbserver/linux-low.c | 4 +++- gdb/gdbserver/spu-low.c | 4 +++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 2a06b99f228..1b96c684e87 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2007-06-20 Daniel Jacobowitz + + * linux-low.c (linux_create_inferior): Try execv before execvp. + * spu-low.c (spu_create_inferior): Likewise. + 2007-06-13 Mike Frysinger * linux-low.c (linux_create_inferior): Change execv to execvp. diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 1ea3ccc0f96..067a63290f3 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -165,7 +165,9 @@ linux_create_inferior (char *program, char **allargs) setpgid (0, 0); - execvp (program, allargs); + execv (program, allargs); + if (errno == ENOENT) + execvp (program, allargs); fprintf (stderr, "Cannot exec %s: %s.\n", program, strerror (errno)); diff --git a/gdb/gdbserver/spu-low.c b/gdb/gdbserver/spu-low.c index 22988246fb7..77f671eb249 100644 --- a/gdb/gdbserver/spu-low.c +++ b/gdb/gdbserver/spu-low.c @@ -278,7 +278,9 @@ spu_create_inferior (char *program, char **allargs) setpgid (0, 0); - execvp (program, allargs); + execv (program, allargs); + if (errno == ENOENT) + execvp (program, allargs); fprintf (stderr, "Cannot exec %s: %s.\n", program, strerror (errno)); -- 2.30.2