common: Fix gnupg_access for older libgpg-error.

--

Fixes-commit: dd5fd4a760
This commit is contained in:
Werner Koch 2020-10-26 10:19:58 +01:00
parent 5f8123df78
commit 56a77f57db
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
1 changed files with 3 additions and 1 deletions

View File

@ -1137,8 +1137,9 @@ gnupg_access (const char *name, int mode)
#if GPGRT_VERSION_NUMBER < 0x012800 /* 1.40 */
# ifdef HAVE_W32_SYSTEM
wchar_t *wfname;
gpg_err_code_t ec;
wfname = utf8_to_wchar (fname);
wfname = utf8_to_wchar (name);
if (!wfname)
ec = gpg_err_code_from_syserror ();
else
@ -1146,6 +1147,7 @@ gnupg_access (const char *name, int mode)
ec = _waccess (wfname, mode)? gpg_err_code_from_syserror () : 0;
xfree (wfname);
}
return ec;
# else
return access (name, mode)? gpg_err_code_from_syserror () : 0;
# endif