logind: method_schedule_shutdown() already rejects empty `type`
authorAlan Jenkins <alan.christopher.jenkins@gmail.com>
Tue, 22 Aug 2017 12:54:21 +0000 (13:54 +0100)
committerAlan Jenkins <alan.christopher.jenkins@gmail.com>
Thu, 24 Aug 2017 11:42:17 +0000 (12:42 +0100)
Don't test for an empty `type` afterwards.  This is not how you cancel
scheduled shutdowns - there's a separate method for that.

src/login/logind-dbus.c

index 0f8d020..3e18064 100644 (file)
@@ -2051,12 +2051,9 @@ static int method_schedule_shutdown(sd_bus_message *message, void *userdata, sd_
         if (r < 0)
                 return r;
 
-        if (!isempty(type)) {
-                r = update_schedule_file(m);
-                if (r < 0)
-                        return r;
-        } else
-                (void) unlink("/run/systemd/shutdown/scheduled");
+        r = update_schedule_file(m);
+        if (r < 0)
+                return r;
 
         return sd_bus_reply_method_return(message, NULL);
 }