mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
common,w32: Add missing GetLastError->errno mapping.
* common/iobuf.c (file_filter, sock_filter): Add missing mapping. -- GnuPG-bug-id: 6528
This commit is contained in:
parent
5377226ec0
commit
5e94470d05
@ -572,8 +572,8 @@ file_filter (void *opaque, int control, iobuf_t chain, byte * buf,
|
||||
{
|
||||
if (size && !WriteFile (f, p, nbytes, &n, NULL))
|
||||
{
|
||||
int ec = (int) GetLastError ();
|
||||
rc = gpg_error_from_errno (ec);
|
||||
int ec = gnupg_w32_set_errno (-1);
|
||||
rc = gpg_error_from_syserror ();
|
||||
log_error ("%s: write error: %s (ec=%d)\n",
|
||||
a->fname, gpg_strerror (rc), ec);
|
||||
break;
|
||||
@ -884,7 +884,8 @@ sock_filter (void *opaque, int control, iobuf_t chain, byte * buf,
|
||||
if (n == SOCKET_ERROR)
|
||||
{
|
||||
int ec = (int) WSAGetLastError ();
|
||||
rc = gpg_error_from_errno (ec);
|
||||
gnupg_w32_set_errno (ec);
|
||||
rc = gpg_error_from_syserror ();
|
||||
log_error ("socket write error: ec=%d\n", ec);
|
||||
break;
|
||||
}
|
||||
|
@ -327,9 +327,10 @@ map_w32_to_errno (DWORD w32_err)
|
||||
#endif /*HAVE_W32_SYSTEM*/
|
||||
|
||||
|
||||
/* Set ERRNO from the Windows error. EC may be -1 to use the last error. */
|
||||
/* Set ERRNO from the Windows error. EC may be -1 to use the last
|
||||
* error. Returns the Windows error code. */
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
void
|
||||
int
|
||||
gnupg_w32_set_errno (int ec)
|
||||
{
|
||||
/* FIXME: Replace by gpgrt_w32_set_errno. */
|
||||
|
@ -110,7 +110,7 @@ int gnupg_inotify_has_name (int fd, const char *name);
|
||||
|
||||
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
void gnupg_w32_set_errno (int ec);
|
||||
int gnupg_w32_set_errno (int ec);
|
||||
void *w32_get_user_sid (void);
|
||||
|
||||
#include "../common/w32help.h"
|
||||
|
Loading…
x
Reference in New Issue
Block a user