ls: set a return error code when skipping an already visited path.

This commit is contained in:
Quentin Rameau 2016-02-18 12:46:48 +01:00 committed by sin
parent 340b163563
commit ac05587385
1 changed files with 2 additions and 2 deletions

4
ls.c
View File

@ -333,8 +333,8 @@ ls(const char *path, const struct entry *ent, int listdir)
} else if (S_ISDIR(ent->mode) ||
(S_ISLNK(ent->mode) && S_ISDIR(ent->tmode))) {
if ((treeind = visit(ent)) < 0) {
fprintf(stderr, "%s%s: already visited\n",
path, ent->name);
ret = 1;
weprintf("%s%s: Already visited\n", path, ent->name);
return;
}