]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Do not try to return 0 from log_debug()
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 14 Apr 2021 15:44:47 +0000 (17:44 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 14 Apr 2021 15:45:11 +0000 (17:45 +0200)
As @yuwata correctly points out, this became broken when log_debug()
started returning -EIO. I wanted to preserve this pattern, but it turns
out it is not very widely used, and preserving it would make the whole
thing, already quite complicated, even more complex.

log_debug() is made like log_info() and friends, and returns void.

src/basic/log.h
src/sleep/sleep.c

index 9a57fcd0f1c0434922aa4a47447e272b02406b2c..81330166a452bdec90a2f62faacda00f2215c801 100644 (file)
@@ -221,7 +221,7 @@ void log_assert_failed_return(
 int log_emergency_level(void);
 
 /* Normal logging */
-#define log_debug(...)     log_full_errno_zerook(LOG_DEBUG, 0, __VA_ARGS__)
+#define log_debug(...)     log_full(LOG_DEBUG,   __VA_ARGS__)
 #define log_info(...)      log_full(LOG_INFO,    __VA_ARGS__)
 #define log_notice(...)    log_full(LOG_NOTICE,  __VA_ARGS__)
 #define log_warning(...)   log_full(LOG_WARNING, __VA_ARGS__)
index 262d4cea66a290aa71e49419113d78b786c42c36..8aeaa1a5434514befd34a760528baae64abca3a8 100644 (file)
@@ -163,10 +163,10 @@ static int lock_all_homes(void) {
                 if (!bus_error_is_unknown_service(&error))
                         return log_error_errno(r, "Failed to lock home directories: %s", bus_error_message(&error, r));
 
-                return log_debug("systemd-homed is not running, locking of home directories skipped.");
-        }
-
-        return log_debug("Successfully requested locking of all home directories.");
+                log_debug("systemd-homed is not running, locking of home directories skipped.");
+        } else
+                log_debug("Successfully requested locking of all home directories.");
+        return 0;
 }
 
 static int execute(char **modes, char **states, const char *action) {