summaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorSam Vilain <sam@vilain.net>2008-11-14 07:19:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-11-28 03:11:21 (GMT)
commit35243577ab460d0b97b97948928d47f71dc8e46a (patch)
treee0438ebed6506debad7a9df55b7d10184aa4207f /sha1_file.c
parent65117abc040d95ef9877c3b14a24f4bc6aeaf4cb (diff)
downloadgit-35243577ab460d0b97b97948928d47f71dc8e46a.zip
git-35243577ab460d0b97b97948928d47f71dc8e46a.tar.gz
git-35243577ab460d0b97b97948928d47f71dc8e46a.tar.bz2
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 <sam@vilain.net>
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 1d7f3b6..4e05429 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));