diff --git a/wrapper.c b/wrapper.c index bac59d2c41bae7441038b30728c696b6280f4c2d..094b2ab9836a4d1d13d432982c6b2582ee3cb13a 100644 --- a/wrapper.c +++ b/wrapper.c @@ -322,7 +322,7 @@ int git_mkstemps_mode(char *pattern, int suffix_len, int mode) template[5] = letters[v % num_letters]; v /= num_letters; fd = open(pattern, O_CREAT | O_EXCL | O_RDWR, mode); - if (fd > 0) + if (fd >= 0) return fd; /* * Fatal error (EPERM, ENOSPC etc).