diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index f8b0adc3347..58b0fd3688a 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -1659,6 +1659,9 @@ static int list_unit_files(int argc, char *argv[], void *userdata) { for (unit = units; unit < units + c; unit++) free(unit->path); + if (c == 0) + return -ENOENT; + return 0; }