From 35243577ab460d0b97b97948928d47f71dc8e46a Mon Sep 17 00:00:00 2001 From: Sam Vilain Date: Fri, 14 Nov 2008 20:19:34 +1300 Subject: [PATCH] sha1_file.c: resolve confusion EACCES vs EPERM An earlier commit 916d081 (Nicer error messages in case saving an object to db goes wrong, 2006-11-09) confused EACCES with EPERM, the latter of which is an unlikely error from mkstemp(). Signed-off-by: Sam Vilain --- sha1_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sha1_file.c b/sha1_file.c index 1d7f3b6ce8..4e05429aba 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -2246,7 +2246,7 @@ static int write_loose_object(const unsigned char *sha1, char *hdr, int hdrlen, filename = sha1_file_name(sha1); fd = create_tmpfile(tmpfile, sizeof(tmpfile), filename); if (fd < 0) { - if (errno == EPERM) + if (errno == EACCES) return error("insufficient permission for adding an object to repository database %s\n", get_object_directory()); else return error("unable to create temporary sha1 filename %s: %s\n", tmpfile, strerror(errno)); -- 2.11.4.GIT