]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: Check clean_or_freeze_unit(): Add assert if unknown method
authorBenjamin Robin <dev@benjarobin.fr>
Sat, 9 May 2020 19:19:17 +0000 (21:19 +0200)
committerBenjamin Robin <dev@benjarobin.fr>
Wed, 13 May 2020 20:56:42 +0000 (22:56 +0200)
src/systemctl/systemctl.c

index 51cd0cf9d36cac767f8b8379e4f4032dc8b7e24c..83d0e397389057e1781b996df90e18da754e5cc0 100644 (file)
@@ -3775,6 +3775,8 @@ static int clean_or_freeze_unit(int argc, char *argv[], void *userdata) {
                 method = "FreezeUnit";
         else if (streq(argv[0], "thaw"))
                 method = "ThawUnit";
+        else
+                assert_not_reached("Unhandled method");
 
         STRV_FOREACH(name, names) {
                 _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;