Skip to content

Commit

Permalink
git_mkstemps_mode: don't set errno to EINVAL on exit.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Matthieu Moy authored and Junio C Hamano committed Feb 22, 2010
1 parent f80c7ae commit 1d9740c
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion path.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 1d9740c

Please sign in to comment.