diff options
Diffstat (limited to 'compat')
-rw-r--r-- | compat/mingw.c | 4 | ||||
-rw-r--r-- | compat/mingw.h | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/compat/mingw.c b/compat/mingw.c index 071863ae7..bee605441 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -198,9 +198,10 @@ static inline time_t filetime_to_time_t(const FILETIME *ft) */ static int do_lstat(int follow, const char *file_name, struct stat *buf) { + int err; WIN32_FILE_ATTRIBUTE_DATA fdata; - if (!(errno = get_file_attr(file_name, &fdata))) { + if (!(err = get_file_attr(file_name, &fdata))) { buf->st_ino = 0; buf->st_gid = 0; buf->st_uid = 0; @@ -233,6 +234,7 @@ static int do_lstat(int follow, const char *file_name, struct stat *buf) } return 0; } + errno = err; return -1; } diff --git a/compat/mingw.h b/compat/mingw.h index 40434d339..228307110 100644 --- a/compat/mingw.h +++ b/compat/mingw.h @@ -37,6 +37,9 @@ typedef int socklen_t; #define WEXITSTATUS(x) ((x) & 0xff) #define WTERMSIG(x) SIGTERM +#define EWOULDBLOCK EAGAIN +#define SHUT_WR SD_SEND + #define SIGHUP 1 #define SIGQUIT 3 #define SIGKILL 9 |