Changed setpgrp to a more portable form.

This commit is contained in:
Adam 2022-09-02 20:26:13 -04:00
parent c25f83da90
commit 4f17667d42
1 changed files with 1 additions and 1 deletions

View File

@ -278,7 +278,7 @@ static int process_start(lua_State* L) {
retval = luaL_error(L, "Error running fork: %s.", strerror(errno));
goto cleanup;
} else if (!self->pid) {
setpgrp();
setpgid(0,0);
for (int stream = 0; stream < 3; ++stream) {
if (new_fds[stream] == REDIRECT_DISCARD) { // Close the stream if we don't want it.
close(self->child_pipes[stream][stream == STDIN_FD ? 0 : 1]);