]> asedeno.scripts.mit.edu Git - git.git/blobdiff - compat/mingw.c
Merge branch 'maint'
[git.git] / compat / mingw.c
index 29f403649f0e3c6d4240fc93e6fa1787a017b9ea..fdbf093f6eb704ec0ca0e5abf6baf1f94350676b 100644 (file)
@@ -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;
 }