Set session ID for fork. Fixes #28

This commit is contained in:
Utkarsh Verma 2022-07-10 14:15:32 +05:30
parent cdc992cc41
commit be46e8a8bd
No known key found for this signature in database
GPG Key ID: 817656CF818EFCCC
1 changed files with 2 additions and 1 deletions

3
main.c
View File

@ -81,8 +81,9 @@ void execBlock(int i, const char* button) {
if (button)
setenv("BLOCK_BUTTON", button, 1);
setsid();
execl("/bin/sh", "sh", "-c", blocks[i].command, (char*)NULL);
_exit(1);
exit(EXIT_SUCCESS);
}
}