mirror of
https://github.com/NickHu/sway
synced 2024-12-30 22:23:30 +01:00
swaylock daemonize: fix leak of devnull fd
This commit is contained in:
parent
4eeca10a8a
commit
2725185aeb
1 changed files with 1 additions and 0 deletions
|
@ -42,6 +42,7 @@ static void daemonize() {
|
|||
int devnull = open("/dev/null", O_RDWR);
|
||||
dup2(STDOUT_FILENO, devnull);
|
||||
dup2(STDERR_FILENO, devnull);
|
||||
close(devnull);
|
||||
uint8_t success = 0;
|
||||
if (chdir("/") != 0) {
|
||||
write(fds[1], &success, 1);
|
||||
|
|
Loading…
Reference in a new issue