Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cygwin: Fix and streamline AT_EMPTY_PATH handling
The GLIBC extension AT_EMPTY_PATH allows the functions fchownat and fstatat to operate on dirfd alone, if the given pathname is an empty string. This also allows to operate on any file type, not only directories. Commit fa84aa4 broke this. It only allows dirfd to be a directory in calls to these two functions. Fix that by handling AT_EMPTY_PATH right in gen_full_path_at. A valid dirfd and an empty pathname is now a valid combination and, noticably, this returns a valid path in path_ret. That in turn allows to remove the additional path generation code from the callers. Fixes: fa84aa4 ("Cygwin: fix errno values set by readlinkat") Reported-by: Johannes Schindelin <[email protected]> Signed-off-by: Corinna Vinschen <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
- Loading branch information