* linux-low.c (linux_create_inferior): Try execv before execvp.
authorDaniel Jacobowitz <drow@false.org>
Wed, 20 Jun 2007 18:54:21 +0000 (18:54 +0000)
committerDaniel Jacobowitz <drow@false.org>
Wed, 20 Jun 2007 18:54:21 +0000 (18:54 +0000)
* spu-low.c (spu_create_inferior): Likewise.

gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-low.c
gdb/gdbserver/spu-low.c

index 2a06b99..1b96c68 100644 (file)
@@ -1,3 +1,8 @@
+2007-06-20  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * linux-low.c (linux_create_inferior): Try execv before execvp.
+       * spu-low.c (spu_create_inferior): Likewise.
+
 2007-06-13  Mike Frysinger  <vapier@gentoo.org>
 
        * linux-low.c (linux_create_inferior): Change execv to execvp.
index 1ea3ccc..067a632 100644 (file)
@@ -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));
index 2298824..77f671e 100644 (file)
@@ -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));