diff options
author | Simon Ser <contact@emersion.fr> | 2021-04-16 10:31:30 +0200 |
---|---|---|
committer | Kenny Levinsen <kl@kl.wtf> | 2021-04-22 23:12:49 +0200 |
commit | 7beeb9e61b7f18a8c2e9aa015958cffde9b76c05 (patch) | |
tree | 78290c40b4cd40e87652387ca9fc8c45b73b857b /sway/swaynag.c | |
parent | Avoid creating zero-sized textures for marks (diff) | |
download | sway-7beeb9e61b7f18a8c2e9aa015958cffde9b76c05.tar.gz sway-7beeb9e61b7f18a8c2e9aa015958cffde9b76c05.tar.zst sway-7beeb9e61b7f18a8c2e9aa015958cffde9b76c05.zip |
Use execlp("sh") instead of execl("/bin/sh")
This stops assuming the POSIX shell command is located in /bin.
Diffstat (limited to 'sway/swaynag.c')
-rw-r--r-- | sway/swaynag.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/swaynag.c b/sway/swaynag.c index db5a919a..ba582989 100644 --- a/sway/swaynag.c +++ b/sway/swaynag.c | |||
@@ -87,8 +87,8 @@ bool swaynag_spawn(const char *swaynag_command, | |||
87 | size_t length = strlen(swaynag_command) + strlen(swaynag->args) + 2; | 87 | size_t length = strlen(swaynag_command) + strlen(swaynag->args) + 2; |
88 | char *cmd = malloc(length); | 88 | char *cmd = malloc(length); |
89 | snprintf(cmd, length, "%s %s", swaynag_command, swaynag->args); | 89 | snprintf(cmd, length, "%s %s", swaynag_command, swaynag->args); |
90 | execl("/bin/sh", "/bin/sh", "-c", cmd, NULL); | 90 | execlp("sh", "sh", "-c", cmd, NULL); |
91 | sway_log_errno(SWAY_ERROR, "execl failed"); | 91 | sway_log_errno(SWAY_ERROR, "execlp failed"); |
92 | _exit(EXIT_FAILURE); | 92 | _exit(EXIT_FAILURE); |
93 | } | 93 | } |
94 | _exit(EXIT_SUCCESS); | 94 | _exit(EXIT_SUCCESS); |