From 1d9740cb324f7f5d798ecfc259dc213b244ad9b7 Mon Sep 17 00:00:00 2001 From: Matthieu Moy Date: Mon, 22 Feb 2010 23:32:15 +0100 Subject: [PATCH] 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 Signed-off-by: Junio C Hamano --- path.c | 1 - 1 file changed, 1 deletion(-) diff --git a/path.c b/path.c index 03d284ba8b..12ef731ace 100644 --- a/path.c +++ b/path.c @@ -222,7 +222,6 @@ int git_mkstemps_mode(char *pattern, int suffix_len, int mode) } /* We return the null string if we can't find a unique file name. */ pattern[0] = '\0'; - errno = EINVAL; return -1; } -- 2.11.4.GIT