chiark / gitweb /
activate: fix error checking on epoll_ctl()
[elogind.git] / src / activate / activate.c
index d73c16e8ab7aee220220b5efb57e538d9f80816c..cf545d61f79092c85de99551a6a0ea3c5a707b14 100644 (file)
@@ -51,10 +51,12 @@ static int add_epoll(int epoll_fd, int fd) {
 
         ev.data.fd = fd;
         r = epoll_ctl(epoll_fd, EPOLL_CTL_ADD, fd, &ev);
 
         ev.data.fd = fd;
         r = epoll_ctl(epoll_fd, EPOLL_CTL_ADD, fd, &ev);
-        if (r < 0)
-                log_error("Failed to add event on epoll fd:%d for fd:%d: %m",
-                          epoll_fd, fd);
-        return -errno;
+        if (r < 0) {
+                log_error("Failed to add event on epoll fd:%d for fd:%d: %m", epoll_fd, fd);
+                return -errno;
+        }
+
+        return 0;
 }
 
 static int make_socket_fd(const char* address, int flags) {
 }
 
 static int make_socket_fd(const char* address, int flags) {