diff options
author | 2018-07-02 09:06:02 +0100 | |
---|---|---|
committer | 2018-07-02 09:06:02 +0100 | |
commit | defb73596fedec846280b9155bb3e9d210da49bb (patch) | |
tree | 0a3e6c9e5efaf0e8bb5f01ab7691350cd063ebcb /swaylock/main.c | |
parent | Merge pull request #2190 from emersion/screencopy (diff) | |
parent | swaylock daemonize: fix leak of devnull fd (diff) | |
download | sway-defb73596fedec846280b9155bb3e9d210da49bb.tar.gz sway-defb73596fedec846280b9155bb3e9d210da49bb.tar.zst sway-defb73596fedec846280b9155bb3e9d210da49bb.zip |
Merge pull request #2186 from martinetd/static-analysis
Static analysis fixes
Diffstat (limited to 'swaylock/main.c')
-rw-r--r-- | swaylock/main.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/swaylock/main.c b/swaylock/main.c index 591df7b4..f31ed679 100644 --- a/swaylock/main.c +++ b/swaylock/main.c | |||
@@ -42,6 +42,7 @@ static void daemonize() { | |||
42 | int devnull = open("/dev/null", O_RDWR); | 42 | int devnull = open("/dev/null", O_RDWR); |
43 | dup2(STDOUT_FILENO, devnull); | 43 | dup2(STDOUT_FILENO, devnull); |
44 | dup2(STDERR_FILENO, devnull); | 44 | dup2(STDERR_FILENO, devnull); |
45 | close(devnull); | ||
45 | uint8_t success = 0; | 46 | uint8_t success = 0; |
46 | if (chdir("/") != 0) { | 47 | if (chdir("/") != 0) { |
47 | write(fds[1], &success, 1); | 48 | write(fds[1], &success, 1); |