]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/sleep/sleep.c
sleep: drop unneeded includes
[thirdparty/systemd.git] / src / sleep / sleep.c
index 8bfc9ee6cc7b7683426d2644e00c1487e62d73cd..05d6e38ae1ff3914a0498bdc62f17f1a5137cddd 100644 (file)
@@ -7,11 +7,9 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <getopt.h>
-#include <linux/fiemap.h>
 #include <poll.h>
-#include <sys/stat.h>
-#include <sys/types.h>
 #include <sys/timerfd.h>
+#include <sys/types.h>
 #include <sys/utsname.h>
 #include <unistd.h>
 
@@ -22,7 +20,6 @@
 
 #include "battery-capacity.h"
 #include "battery-util.h"
-#include "btrfs-util.h"
 #include "build.h"
 #include "bus-error.h"
 #include "bus-locator.h"
@@ -284,7 +281,7 @@ static int execute(
         setvbuf(f, NULL, _IONBF, 0);
 
         /* Configure hibernation settings if we are supposed to hibernate */
-        if (!strv_isempty(modes)) {
+        if (sleep_operation_is_hibernation(operation)) {
                 bool resume_set;
 
                 r = find_suitable_hibernation_device(&hibernation_device);
@@ -560,6 +557,7 @@ static int help(void) {
 }
 
 static int parse_argv(int argc, char *argv[]) {
+
         enum {
                 ARG_VERSION = 0x100,
         };
@@ -577,6 +575,7 @@ static int parse_argv(int argc, char *argv[]) {
 
         while ((c = getopt_long(argc, argv, "h", options, NULL)) >= 0)
                 switch (c) {
+
                 case 'h':
                         return help();
 
@@ -588,6 +587,7 @@ static int parse_argv(int argc, char *argv[]) {
 
                 default:
                         assert_not_reached();
+
                 }
 
         if (argc - optind != 1)
@@ -644,6 +644,7 @@ static int run(int argc, char *argv[]) {
         default:
                 r = execute(sleep_config, arg_operation, NULL);
                 break;
+
         }
 
         return r;