aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-11-30 20:25:10 +0100
committerDaniel Eklöf <daniel@ekloef.se>2020-11-30 20:25:10 +0100
commit518150555d1a066f597bfae83a59b405c15f9c33 (patch)
treeef848c7708cc5a5afea7edc0be37105bf5ea0690 /main.c
parente24f5fbd6047350e7ae3014c1ad5d2eba93d4e8b (diff)
downloadwbg-518150555d1a066f597bfae83a59b405c15f9c33.tar.gz
main: fix “may be used uninitialized” error
Diffstat (limited to 'main.c')
-rw-r--r--main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/main.c b/main.c
index c149649..b6bf232 100644
--- a/main.c
+++ b/main.c
@@ -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;
}