Skip to content

Commit

Permalink
cmd: Pass environ(7) to posix_spawnp
Browse files Browse the repository at this point in the history
  • Loading branch information
obiwac committed Nov 6, 2024
1 parent 13c158f commit b5abb8d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,10 @@ pid_t cmd_exec_async(cmd_t* cmd) {
posix_spawn_file_actions_adddup2(&actions, cmd->in, STDOUT_FILENO);
posix_spawn_file_actions_adddup2(&actions, cmd->in, STDERR_FILENO);

extern char** environ;
pid_t pid;

if (posix_spawnp(&pid, path, &actions, NULL, cmd->args, NULL) < 0) {
if (posix_spawnp(&pid, path, &actions, NULL, cmd->args, environ) < 0) {
LOG_ERROR("posix_spawnp: %s", strerror(errno));
pid = -1;

Expand Down

0 comments on commit b5abb8d

Please sign in to comment.