chiark / gitweb /
bus-proxy: make sure sure eavesdrop= XML attributes are properly handled
[elogind.git] / src / sleep / sleep.c
index a7506ed7711a99f13ddcf8a5b033ba09eaf3980f..56b963a7292165865f407cb573e836bd27ce10f4 100644 (file)
@@ -77,10 +77,8 @@ static int write_state(FILE **f, char **states) {
 
                 fclose(*f);
                 *f = fopen("/sys/power/state", "we");
-                if (!*f) {
-                        log_error_errno(errno, "Failed to open /sys/power/state: %m");
-                        return -errno;
-                }
+                if (!*f)
+                        return log_error_errno(errno, "Failed to open /sys/power/state: %m");
         }
 
         return r;
@@ -101,10 +99,8 @@ static int execute(char **modes, char **states) {
         /* This file is opened first, so that if we hit an error,
          * we can abort before modifying any state. */
         f = fopen("/sys/power/state", "we");
-        if (!f) {
-                log_error_errno(errno, "Failed to open /sys/power/state: %m");
-                return -errno;
-        }
+        if (!f)
+                return log_error_errno(errno, "Failed to open /sys/power/state: %m");
 
         /* Configure the hibernation mode */
         r = write_mode(modes);
@@ -125,7 +121,7 @@ static int execute(char **modes, char **states) {
 
         log_struct(LOG_INFO,
                    LOG_MESSAGE_ID(SD_MESSAGE_SLEEP_STOP),
-                   LOG_MESSAGE("MESSAGE=System resumed."),
+                   LOG_MESSAGE("System resumed."),
                    "SLEEP=%s", arg_verb,
                    NULL);