diff options
author | Daniel Eklöf <daniel@ekloef.se> | 2020-11-30 20:25:10 +0100 |
---|---|---|
committer | Daniel Eklöf <daniel@ekloef.se> | 2020-11-30 20:25:10 +0100 |
commit | 518150555d1a066f597bfae83a59b405c15f9c33 (patch) | |
tree | ef848c7708cc5a5afea7edc0be37105bf5ea0690 /main.c | |
parent | e24f5fbd6047350e7ae3014c1ad5d2eba93d4e8b (diff) | |
download | wbg-518150555d1a066f597bfae83a59b405c15f9c33.tar.gz |
main: fix “may be used uninitialized” error
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -344,6 +344,7 @@ main(int argc, const char *const *argv) } int exit_code = EXIT_FAILURE; + int sig_fd = -1; display = wl_display_connect(NULL); if (display == NULL) { @@ -387,8 +388,7 @@ main(int argc, const char *const *argv) sigprocmask(SIG_BLOCK, &mask, NULL); - int sig_fd = signalfd(-1, &mask, 0); - if (sig_fd < 0) { + if ((sig_fd = signalfd(-1, &mask, 0)) < 0) { LOG_ERRNO("failed to create signal FD"); goto out; } |