summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1c7d402)
raw | patch | inline | side by side (parent: 1c7d402)
author | Erik Faye-Lund <kusmabite@gmail.com> | |
Tue, 23 Nov 2010 19:53:08 +0000 (20:53 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 24 Nov 2010 00:08:01 +0000 (16:08 -0800) |
Currently do_lstat always sets errno to 0 on success. This incorrectly
overwrites previous errors.
Fetch the error-code into a temporary variable instead, and assign that
to errno on failure.
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
overwrites previous errors.
Fetch the error-code into a temporary variable instead, and assign that
to errno on failure.
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.c | patch | blob | history |
diff --git a/compat/mingw.c b/compat/mingw.c
index f2d9e1fd974b7271366da09370e10fafd2c50f08..b98e6000062134f01a0611fb17a3fd43250f7989 100644 (file)
--- a/compat/mingw.c
+++ b/compat/mingw.c
*/
static int do_lstat(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;
buf->st_ctime = filetime_to_time_t(&(fdata.ftCreationTime));
return 0;
}
+ errno = err;
return -1;
}