From 518150555d1a066f597bfae83a59b405c15f9c33 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Mon, 30 Nov 2020 20:25:10 +0100 Subject: main: fix “may be used uninitialized” error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.c | 4 ++-- 1 file 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; } -- cgit v1.2.3