summaryrefslogtreecommitdiffstats
path: root/src/sleep
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2024-05-31 06:18:44 +0200
committerMike Yuan <me@yhndnzj.com>2024-07-17 18:14:32 +0200
commita99935557a664d6e70dc03944216834c224532b1 (patch)
treebcc7e876016efde38c77847426202b444bb27369 /src/sleep
parentcore/dbus-unit: add an explicit bus error when unit is frozen by parent (diff)
downloadsystemd-a99935557a664d6e70dc03944216834c224532b1.tar.xz
systemd-a99935557a664d6e70dc03944216834c224532b1.zip
sleep: explicitly list valid sleep operations in switch
To follow our usual coding style.
Diffstat (limited to 'src/sleep')
-rw-r--r--src/sleep/sleep.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c
index d8491ca7b3..88fb5ecab2 100644
--- a/src/sleep/sleep.c
+++ b/src/sleep/sleep.c
@@ -631,10 +631,13 @@ static int run(int argc, char *argv[]) {
break;
- default:
+ case SLEEP_SUSPEND:
+ case SLEEP_HIBERNATE:
r = execute(sleep_config, arg_operation, NULL);
break;
+ default:
+ assert_not_reached();
}
if (user_slice_freezer)