t7610: don't use test_config in a subshell
[gitweb.git] / sha1_file.c
index 1cee4384225fb9fab1a4b2a4949c8f730eb125ae..f2e993e0b8b998c91b945771a87a099d882448f5 100644 (file)
@@ -1461,7 +1461,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;