From 1f572864da9682a7d423477b1795b7dacc1f11da Mon Sep 17 00:00:00 2001 From: Vladimir Mezentsev Date: Tue, 15 Aug 2023 19:45:12 -0700 Subject: 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 * src/gp-display-text.cc (reexec): Use execvp instead of execv. --- gprofng/src/gp-display-text.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gprofng/src') 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 // isatty +#include #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); } /** -- cgit v1.1