@matheusbsbs / matheus-bagliano / commits / 35243577ab
Fork 0

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>

Sam Vilain committed Nov 14, 2008 at 20:19 UTC 35243577ab460d0b97b97948928d47f71dc8e46a
1 file changed +1 -1
sha1_file.c
+1 -1
@@ -2246,7 +2246,7 @@ static int write_loose_object(const unsigned char *sha1, char *hdr, int hdrlen,
2246 filename = sha1_file_name(sha1);
2247 fd = create_tmpfile(tmpfile, sizeof(tmpfile), filename);
2248 if (fd < 0) {
2249 - if (errno == EPERM)
2249 + if (errno == EACCES)
2250 return error("insufficient permission for adding an object to repository database %s\n", get_object_directory());
2251 else
2252 return error("unable to create temporary sha1 filename %s: %s\n", tmpfile, strerror(errno));