On Tue Sep 27 16:32:20 2022 +0000, Erich Hoover wrote:
The reason that I originally posted this as two separate commits was that I didn't know if `AT_EMPTY_PATH` was available on other platforms. Clearly it's not available on at least Mac OS, so I would suggest that instead of using `fstatat` here that we do something like the following:
... if (fd == AT_FDCWD) ret = lstat( path, st ); else ret = fstat( fd, st ); if (ret == -1) return ret; if (S_ISLNK( st->st_mode )) { if (fd == AT_FDCWD) ret = stat( path, st ); ...
We could also introduce an internal fstatat-like routine, but that may not be worth the trouble given that this is the only place (that I'm aware of) that would benefit from this.
Just applied the change.