ls: Fix duplicated error message when opening a directory fails

This commit is contained in:
Marco Cutecchia 2022-01-04 21:19:23 +01:00 committed by Andreas Kling
parent 70f707d806
commit 732e41714a
Notes: sideshowbarker 2024-07-17 21:39:29 +09:00

View file

@ -148,8 +148,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
metadata.name = path;
int rc = lstat(String(path).characters(), &metadata.stat);
if (rc < 0)
if (rc < 0) {
perror("lstat");
continue;
}
files.append(metadata);
}