Fix ls(1) not checking stat_record()'s error correctly.
This commit is contained in:
parent
db90720c01
commit
8467102662
|
@ -814,7 +814,7 @@ static int ls_directory(int parentfd, const char* relpath, const char* path)
|
||||||
memset(record, 0, sizeof(*record));
|
memset(record, 0, sizeof(*record));
|
||||||
if ( !(record->dirent = dirent_dup(entry)) )
|
if ( !(record->dirent = dirent_dup(entry)) )
|
||||||
err(1, "malloc");
|
err(1, "malloc");
|
||||||
if ( stat_record(dir, path, record) < 0 )
|
if ( !stat_record(dir, path, record) )
|
||||||
ret = 1;
|
ret = 1;
|
||||||
record->no_recurse = isdotdot;
|
record->no_recurse = isdotdot;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue