mirror of
https://github.com/swaywm/sway.git
synced 2024-11-10 12:33:50 +01:00
switch to execle and supply child_envp as the environment pointer
This commit is contained in:
parent
124b1f1248
commit
d211b7d4a9
@ -4,6 +4,7 @@
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <glib.h>
|
||||
#include "sway/commands.h"
|
||||
#include "sway/config.h"
|
||||
#include "sway/server.h"
|
||||
@ -14,6 +15,8 @@
|
||||
#include "log.h"
|
||||
#include "stringop.h"
|
||||
|
||||
extern char** child_envp;
|
||||
|
||||
struct cmd_results *cmd_exec_validate(int argc, char **argv) {
|
||||
struct cmd_results *error = NULL;
|
||||
if ((error = checkarg(argc, argv[-1], EXPECTED_AT_LEAST, 1))) {
|
||||
@ -81,7 +84,7 @@ struct cmd_results *cmd_exec_process(int argc, char **argv) {
|
||||
if (ctx && !no_startup_id) {
|
||||
export_startup_id(ctx);
|
||||
}
|
||||
execlp("sh", "sh", "-c", cmd, (void *)NULL);
|
||||
execle("/bin/sh", "sh", "-c", cmd, (void *)NULL, child_envp);
|
||||
sway_log_errno(SWAY_ERROR, "execlp failed");
|
||||
_exit(1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user