aboutsummaryrefslogtreecommitdiff
path: root/gprofng
diff options
context:
space:
mode:
authorVladimir Mezentsev <vladimir.mezentsev@oracle.com>2023-08-15 19:45:12 -0700
committerVladimir Mezentsev <vladimir.mezentsev@oracle.com>2023-08-17 13:15:10 -0700
commit1f572864da9682a7d423477b1795b7dacc1f11da (patch)
treed47732322f7172113b221c4e5a298374eec6ed29 /gprofng
parentb080fe54fb3414b488b8ef323c6c50def061f918 (diff)
downloadgdb-1f572864da9682a7d423477b1795b7dacc1f11da.zip
gdb-1f572864da9682a7d423477b1795b7dacc1f11da.tar.gz
gdb-1f572864da9682a7d423477b1795b7dacc1f11da.tar.bz2
gprofng: Use execvp instead of execv
gp-display-gui (https://savannah.gnu.org/projects/gprofng-gui) can be installed in a different directory. In this case, $PATH is used to look up gp-display-text. execv() does not use $PATH to find the executable. gprofng/ChangeLog 2023-08-15 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> * src/gp-display-text.cc (reexec): Use execvp instead of execv.
Diffstat (limited to 'gprofng')
-rw-r--r--gprofng/src/gp-display-text.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/gprofng/src/gp-display-text.cc b/gprofng/src/gp-display-text.cc
index 0d0a5e7..85ae274 100644
--- a/gprofng/src/gp-display-text.cc
+++ b/gprofng/src/gp-display-text.cc
@@ -20,6 +20,7 @@
#include "config.h"
#include <unistd.h> // isatty
+#include <errno.h>
#include "gp-print.h"
#include "ipcio.h"
@@ -55,7 +56,11 @@ reexec ()
{
if (dbeSession != NULL)
dbeSession->unlink_tmp_files ();
- execv (exe_name, new_argv);
+ execvp (exe_name, new_argv);
+ fprintf (stderr, GTXT ("Error: reexec() failed (%d: %s)\n"), errno,
+ STR(strerror (errno)));
+ fflush (stderr);
+ exit (1);
}
/**