On 3/23/20 9:07 PM, Alistair Leslie-Hughes wrote:
- return S_ISDIR( st->st_mode ) && !fstatat( fd, "..", &parent, 0 )
- return S_ISDIR( st->st_mode ) && !lstat( "..", &parent)
These aren't the same. For relative paths, fstatat takes it as relative to the directory indicated by 'fd', whereas lstat takes it as relative to the current working directory. Also, fstatat goes through symlinks by default, whereas lstat doesn't (not likely to be an issue for '..', but technically different nonetheless).