1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-18 03:40:47 -08:00

Revert "Don’t assume openat"

This reverts commit 3cccf0a910.

This is a change with far-reaching effects on MS-Windows at the least,
where file-related APIs are shadowed to support transparent support
for UTF-8 encoded file names.  Making such changes on a stable branch
for the benefit of a proprietary platform with a 13-year old OS is a
tail wagging the dog.  Please don't do that without discussing first.
This commit is contained in:
Eli Zaretskii 2022-04-17 22:03:52 +03:00
parent 3cccf0a910
commit c2f94f32b5
2 changed files with 13 additions and 19 deletions

View file

@ -1412,7 +1412,8 @@ local_sockname (int s, char sockname[socknamesize], int tmpdirlen,
char *emacsdirend = sockname + tmpdirlen + suffixlen -
strlen(server_name) - 1;
*emacsdirend = '\0';
int dir = open (sockname, O_PATH | O_DIRECTORY | O_NOFOLLOW | O_CLOEXEC);
int dir = openat (AT_FDCWD, sockname,
O_PATH | O_DIRECTORY | O_NOFOLLOW | O_CLOEXEC);
*emacsdirend = '/';
if (dir < 0)
return errno;