summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sha1_file.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sha1_file.c b/sha1_file.c
index d7f1838c13..3502dcf666 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -1446,7 +1446,10 @@ int git_open_noatime(const char *name)
static int sha1_file_open_flag = O_NOATIME;
for (;;) {
- int fd = open(name, O_RDONLY | sha1_file_open_flag);
+ int fd;
+
+ errno = 0;
+ fd = open(name, O_RDONLY | sha1_file_open_flag);
if (fd >= 0)
return fd;