From: Matthieu Moy Date: Fri, 19 Feb 2010 23:21:57 GMT Subject: [PATCH 5/6] git_mkstemps_mode: don't set errno to EINVAL for any error. Message-ID: <1266621718-4879-5-git-send-email-Matthieu.Moy@imag.fr> In-Reply-To: Signed-off-by: Matthieu Moy --- path.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/path.c b/path.c index 005b836..2886eb6 100644 --- a/path.c +++ b/path.c @@ -222,7 +222,9 @@ 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; + /* Make sure errno signals an error on failure */ + if (errno <= 0) + errno = EINVAL; return -1; } -- 1.7.0.rc2.92.gb6a04