Skip to content

Commit 3524357

Browse files
samvgitster
authored andcommitted
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 <[email protected]>
1 parent 65117ab commit 3524357

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sha1_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2246,7 +2246,7 @@ static int write_loose_object(const unsigned char *sha1, char *hdr, int hdrlen,
22462246
filename = sha1_file_name(sha1);
22472247
fd = create_tmpfile(tmpfile, sizeof(tmpfile), filename);
22482248
if (fd < 0) {
2249-
if (errno == EPERM)
2249+
if (errno == EACCES)
22502250
return error("insufficient permission for adding an object to repository database %s\n", get_object_directory());
22512251
else
22522252
return error("unable to create temporary sha1 filename %s: %s\n", tmpfile, strerror(errno));

0 commit comments

Comments
 (0)