[pacman-dev] [PATCH] hook.c: replace fstatat with stat
macOS < 10.10 do not provide fstatat. We were constructing the full path to the hook file for all other operations anyway, so there was no real benefit to using fstatat. Fixes FS#49771 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> --- lib/libalpm/hook.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libalpm/hook.c b/lib/libalpm/hook.c index 9b4f215..ccde225 100644 --- a/lib/libalpm/hook.c +++ b/lib/libalpm/hook.c @@ -675,7 +675,7 @@ int _alpm_hook_run(alpm_handle_t *handle, alpm_hook_when_t when) continue; } - if(fstatat(dirfd(d), entry->d_name, &buf, 0) != 0) { + if(stat(path, &buf) != 0) { _alpm_log(handle, ALPM_LOG_ERROR, _("could not stat file %s: %s\n"), path, strerror(errno)); ret = -1; -- 2.9.0
On 28/06/16 12:23, Andrew Gregory wrote:
macOS < 10.10 do not provide fstatat. We were constructing the full path to the hook file for all other operations anyway, so there was no real benefit to using fstatat.
Fixes FS#49771
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Thanks. Will backport this to the 5.0.x branch if I get time to think about another release from there. A
participants (2)
-
Allan McRae
-
Andrew Gregory