Do not return garbage in run_parts

If scandir(3) returns 0, the uninitialized value of execute_result will
be returned.
This commit is contained in:
Christian Göttsche 2022-01-03 13:12:31 +01:00
parent a8166a86ed
commit b2bc1f6927

View File

@ -48,7 +48,7 @@ int run_parts (const char *directory, const char *name, const char *action)
int execute_result;
scanlist = scandir (directory, &namelist, 0, alphasort);
if (scanlist<0) {
if (scanlist<=0) {
return (0);
}