[gnome-session] gnome-session-inhibit: fix child cmd arguments
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-session] gnome-session-inhibit: fix child cmd arguments
- Date: Tue, 5 Sep 2017 20:16:53 +0000 (UTC)
commit 3ef9795dc5e603cf2ba331ac2b1f72a725a9e19b
Author: Maxime de Roucy <maxime deroucy oxalide com>
Date: Wed Oct 12 22:38:51 2016 +0200
gnome-session-inhibit: fix child cmd arguments
int execvp(const char *file, char *const argv[]);
The execv(), execvp(), and execvpe() functions provide an array of pointers
to null-terminated strings that represent the argument list available to the
new program. The first argument, by convention, should point to the filename
associated with the file being executed.
In the above paragraph "The first argument" is argv[0] (not the first
parameter of the execvp function).
https://bugzilla.gnome.org/show_bug.cgi?id=772825
tools/gnome-session-inhibit.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/tools/gnome-session-inhibit.c b/tools/gnome-session-inhibit.c
index 1c7a56d..d1d3bc6 100644
--- a/tools/gnome-session-inhibit.c
+++ b/tools/gnome-session-inhibit.c
@@ -142,7 +142,7 @@ wait_for_child_app (char **argv)
if (pid == 0)
{
- execvp (*argv, argv + 1);
+ execvp (*argv, argv);
g_print (_("Failed to execute %s\n"), *argv);
exit (1);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]