swaylock daemonize: fix leak of devnull fd
This commit is contained in:
parent
d68ddd1532
commit
8406c501b9
1
main.c
1
main.c
@ -42,6 +42,7 @@ static void daemonize() {
|
|||||||
int devnull = open("/dev/null", O_RDWR);
|
int devnull = open("/dev/null", O_RDWR);
|
||||||
dup2(STDOUT_FILENO, devnull);
|
dup2(STDOUT_FILENO, devnull);
|
||||||
dup2(STDERR_FILENO, devnull);
|
dup2(STDERR_FILENO, devnull);
|
||||||
|
close(devnull);
|
||||||
uint8_t success = 0;
|
uint8_t success = 0;
|
||||||
if (chdir("/") != 0) {
|
if (chdir("/") != 0) {
|
||||||
write(fds[1], &success, 1);
|
write(fds[1], &success, 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user