systemctl: Check clean_or_freeze_unit(): Add assert if unknown method

This commit is contained in:
Benjamin Robin 2020-05-09 21:19:17 +02:00
parent 81c5a5961f
commit fbb0b66577
1 changed files with 2 additions and 0 deletions

View 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;