Skip to content

Commit 1d9740c

Browse files
moygitster
authored andcommitted
git_mkstemps_mode: don't set errno to EINVAL on exit.
When reaching the end of git_mkstemps_mode, at least one call to open() has been done, and errno has been set accordingly. Setting errno is therefore not necessary, and actually harmfull since callers can't distinguish e.g. permanent failure from ENOENT, which can just mean that we need to create the containing directory. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent f80c7ae commit 1d9740c

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

path.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ int git_mkstemps_mode(char *pattern, int suffix_len, int mode)
222222
}
223223
/* We return the null string if we can't find a unique file name. */
224224
pattern[0] = '\0';
225-
errno = EINVAL;
226225
return -1;
227226
}
228227

0 commit comments

Comments
 (0)