1. Stefan Saasen
  2. git


Sam Vilain  committed 3524357

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>

  • Participants
  • Parent commits 65117ab
  • Branches master

Comments (0)

Files changed (1)

File sha1_file.c

View file
  • Ignore whitespace
 	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());
 			return error("unable to create temporary sha1 filename %s: %s\n", tmpfile, strerror(errno));