]> git.ipfire.org Git - fireperf.git/commitdiff
main: Ensure that epollfd is always initialized
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 23 Feb 2021 14:46:09 +0000 (14:46 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 23 Feb 2021 14:46:09 +0000 (14:46 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/main.c

index db41642113d7ac0fe5eef83b50e607a15a0aa8af..c418143c6bb2b3ea9f986a88574d58e730d8e637 100644 (file)
@@ -258,6 +258,7 @@ int main(int argc, char* argv[]) {
        };
        struct fireperf_stats stats = { 0 };
        int r;
+       int epollfd = -1;
        int timerfd = -1;
 
        // Parse command line
@@ -284,7 +285,7 @@ int main(int argc, char* argv[]) {
        }
 
        // Initialize epoll()
-       int epollfd = epoll_create1(0);
+       epollfd = epoll_create1(0);
        if (epollfd < 0) {
                ERROR(&conf, "Could not initialize epoll(): %s\n", strerror(errno));
                r = 1;