From: Benjamin Robin Date: Sat, 9 May 2020 19:19:17 +0000 (+0200) Subject: systemctl: Check clean_or_freeze_unit(): Add assert if unknown method X-Git-Tag: v246-rc1~373^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fbb0b665773690ab753d1428fd6b8a4621e58496;p=thirdparty%2Fsystemd.git systemctl: Check clean_or_freeze_unit(): Add assert if unknown method --- diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 51cd0cf9d36..83d0e397389 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -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;