chiark / gitweb /
errno is positive
[elogind.git] / src / login / sd-login.c
index 7513f76cb3fc3397da3389dd81208abc3d14e12c..f433e3e80b15fc5b87f742d0f6a6627876a6dbf9 100644 (file)
@@ -730,7 +730,7 @@ _public_ int sd_login_monitor_new(const char *category, sd_login_monitor **m) {
 
         fd = inotify_init1(IN_NONBLOCK|IN_CLOEXEC);
         if (fd < 0)
-                return errno;
+                return -errno;
 
         if (!category || streq(category, "seat")) {
                 k = inotify_add_watch(fd, "/run/systemd/seats/", IN_MOVED_TO|IN_DELETE);