chiark / gitweb /
Revert "log_error() if inotify_add_watch() fails"
authorLennart Poettering <lennart@poettering.net>
Wed, 13 Feb 2013 15:25:33 +0000 (16:25 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 13 Feb 2013 15:25:33 +0000 (16:25 +0100)
This reverts commit 2826d14091e43ed3397d862dee79d09d0115c84e.

We never should generate log messages from a library.

src/login/sd-login.c
src/readahead/readahead-common.c
src/shared/ask-password-api.c
src/shared/util.c
src/tty-ask-password-agent/tty-ask-password-agent.c

index 865527f8dda937f310656ccc37db69df294cae70..b81dddf86ba79d36259fd544476ca754ff3c2e8f 100644 (file)
@@ -733,7 +733,6 @@ _public_ int sd_login_monitor_new(const char *category, sd_login_monitor **m) {
         if (!category || streq(category, "seat")) {
                 k = inotify_add_watch(fd, "/run/systemd/seats/", IN_MOVED_TO|IN_DELETE);
                 if (k < 0) {
         if (!category || streq(category, "seat")) {
                 k = inotify_add_watch(fd, "/run/systemd/seats/", IN_MOVED_TO|IN_DELETE);
                 if (k < 0) {
-                        log_error("Failed to add watch on /run/systemd/seats/: %m");
                         close_nointr_nofail(fd);
                         return -errno;
                 }
                         close_nointr_nofail(fd);
                         return -errno;
                 }
@@ -744,7 +743,6 @@ _public_ int sd_login_monitor_new(const char *category, sd_login_monitor **m) {
         if (!category || streq(category, "session")) {
                 k = inotify_add_watch(fd, "/run/systemd/sessions/", IN_MOVED_TO|IN_DELETE);
                 if (k < 0) {
         if (!category || streq(category, "session")) {
                 k = inotify_add_watch(fd, "/run/systemd/sessions/", IN_MOVED_TO|IN_DELETE);
                 if (k < 0) {
-                        log_error("Failed to add watch on /run/systemd/sessions/: %m");
                         close_nointr_nofail(fd);
                         return -errno;
                 }
                         close_nointr_nofail(fd);
                         return -errno;
                 }
@@ -755,7 +753,6 @@ _public_ int sd_login_monitor_new(const char *category, sd_login_monitor **m) {
         if (!category || streq(category, "uid")) {
                 k = inotify_add_watch(fd, "/run/systemd/users/", IN_MOVED_TO|IN_DELETE);
                 if (k < 0) {
         if (!category || streq(category, "uid")) {
                 k = inotify_add_watch(fd, "/run/systemd/users/", IN_MOVED_TO|IN_DELETE);
                 if (k < 0) {
-                        log_error("Failed to add watch on /run/systemd/users/: %m");
                         close_nointr_nofail(fd);
                         return -errno;
                 }
                         close_nointr_nofail(fd);
                         return -errno;
                 }
index 1599ac15a476b628bc27b86a0176a446bf84bd86..41aaff0a3d1532caf323f936bb9577e3a21df24b 100644 (file)
@@ -227,7 +227,7 @@ int open_inotify(void) {
         mkdir("/run/systemd/readahead", 0755);
 
         if (inotify_add_watch(fd, "/run/systemd/readahead", IN_CREATE) < 0) {
         mkdir("/run/systemd/readahead", 0755);
 
         if (inotify_add_watch(fd, "/run/systemd/readahead", IN_CREATE) < 0) {
-                log_error("Failed to add watch on /run/systemd/readahead: %m");
+                log_error("Failed to watch /run/systemd/readahead: %m");
                 close_nointr_nofail(fd);
                 return -errno;
         }
                 close_nointr_nofail(fd);
                 return -errno;
         }
index 10e6ae0614809ca9a6df9667b4944ce89f6be1c0..8a0fb89a84b8b69f61cb0a316e4c4d16ba7f56a4 100644 (file)
@@ -78,7 +78,6 @@ int ask_password_tty(
                 }
 
                 if (inotify_add_watch(notify, flag_file, IN_ATTRIB /* for the link count */) < 0) {
                 }
 
                 if (inotify_add_watch(notify, flag_file, IN_ATTRIB /* for the link count */) < 0) {
-                        log_error("Failed to add watch on %s: %m", flag_file);
                         r = -errno;
                         goto finish;
                 }
                         r = -errno;
                         goto finish;
                 }
index 6ef191422c2dcc743a3e1e79ce898022983cf304..d754c836f2b5386cd01f711fb71b74e030a4aa30 100644 (file)
@@ -2220,7 +2220,6 @@ int acquire_terminal(
                 wd = inotify_add_watch(notify, name, IN_CLOSE);
                 if (wd < 0) {
                         r = -errno;
                 wd = inotify_add_watch(notify, name, IN_CLOSE);
                 if (wd < 0) {
                         r = -errno;
-                        log_error("Failed to add watch on %s: %m", name);
                         goto fail;
                 }
         }
                         goto fail;
                 }
         }
index 276ccf9780e3b7558a1282cf97f7acfae1cf83f8..99a626c6c58ad960ccf1e762e0b5426182b08f83 100644 (file)
@@ -81,7 +81,6 @@ static int ask_password_plymouth(
                 }
 
                 if (inotify_add_watch(notify, flag_file, IN_ATTRIB /* for the link count */) < 0) {
                 }
 
                 if (inotify_add_watch(notify, flag_file, IN_ATTRIB /* for the link count */) < 0) {
-                        log_error("Failed to add watch on %s: %m", flag_file);
                         r = -errno;
                         goto finish;
                 }
                         r = -errno;
                         goto finish;
                 }
@@ -578,7 +577,6 @@ static int watch_passwords(void) {
         }
 
         if (inotify_add_watch(notify, "/run/systemd/ask-password", IN_CLOSE_WRITE|IN_MOVED_TO) < 0) {
         }
 
         if (inotify_add_watch(notify, "/run/systemd/ask-password", IN_CLOSE_WRITE|IN_MOVED_TO) < 0) {
-                log_error("Failed to add watch on /run/systemd/ask-password: %m");
                 r = -errno;
                 goto finish;
         }
                 r = -errno;
                 goto finish;
         }