diff options
author | Werner Koch <[email protected]> | 2020-10-23 18:14:45 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2020-10-23 18:16:18 +0000 |
commit | 32f336d9555f18464d72a5068c290ab82ee92617 (patch) | |
tree | e6199576ff091fc57e64430564cf54691fd47884 /common/sysutils.c | |
parent | scd: Handle Yubikey's multiple apps and serialno. (diff) | |
download | gnupg-32f336d9555f18464d72a5068c290ab82ee92617.tar.gz gnupg-32f336d9555f18464d72a5068c290ab82ee92617.zip |
common: Allow building with released libgpg-error.
* common/sysutils.c (gnupg_access) [W32]: Fix for older libgpgrt.
--
Fixes-commit: c94ee1386e0d5cdac51086c4d5b92de59c09c9b5
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to '')
-rw-r--r-- | common/sysutils.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/common/sysutils.c b/common/sysutils.c index 25de374a3..45a6d8c80 100644 --- a/common/sysutils.c +++ b/common/sysutils.c @@ -1105,22 +1105,24 @@ gnupg_getcwd (void) gpg_err_code_t gnupg_access (const char *name, int mode) { -#if GPGRT_VERSION_NUMBER < 0x012800 /* 1.39 */ +#if GPGRT_VERSION_NUMBER < 0x012800 /* 1.40 */ # ifdef HAVE_W32_SYSTEM - wchar_t *wfname; + wchar_t *wname; + gpg_err_code_t ec; - wfname = utf8_to_wchar (fname); - if (!wfname) + wname = utf8_to_wchar (name); + if (!wname) ec = gpg_err_code_from_syserror (); else { - ec = _waccess (wfname, mode)? gpg_err_code_from_syserror () : 0; - xfree (wfname); + ec = _waccess (wname, mode)? gpg_err_code_from_syserror () : 0; + xfree (wname); } + return ec; # else return access (name, mode)? gpg_err_code_from_syserror () : 0; # endif -#else +#else /* gpgrt 1.40 or newer. */ return gpgrt_access (name, mode); #endif } |