chiark / gitweb /
log.h: new log_oom() -> int -ENOMEM, use it
[elogind.git] / src / shutdownd / shutdownd.c
index 0497cd41a05ee8ed90c6042e22da3528dde3778a..d426d9833d79359f7c340d8ea137e620b30d5e57 100644 (file)
@@ -205,17 +205,15 @@ static int update_schedule_file(struct sd_shutdown_command *c) {
 
         assert(c);
 
-        r = safe_mkdir("/run/systemd/shutdown", 0755, 0, 0);
+        r = mkdir_safe_label("/run/systemd/shutdown", 0755, 0, 0);
         if (r < 0) {
                 log_error("Failed to create shutdown subdirectory: %s", strerror(-r));
                 return r;
         }
 
         t = cescape(c->wall_message);
-        if (!t) {
-                log_error("Out of memory");
-                return -ENOMEM;
-        }
+        if (!t)
+                return log_oom();
 
         r = fopen_temporary("/run/systemd/shutdown/scheduled", &f, &temp_path);
         if (r < 0) {