Skip to contentSkip to conversation

Really honor umask when creating files

PATCH New Junio C Hamano 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Really honor umask when creating files

The stated plan was to create new files with either 0666 or 0777 and let the system take care of applying umask(). Running fchmod afterwards defeats this plan, so drop it.

You still need to spell your octals with prefix in addition to this patch.

---

 checkout-cache.c |    2 --
 1 files changed, 2 deletions(-)

checkout-cache.c: a87022a97c4604ef42ae6c31d641dc749a076ca3

checkout-cache.c +0 -2
@@ -62,8 +62,6 @@
 			fd = open(path, O_WRONLY | O_TRUNC | O_CREAT, mode);
 		}
 	}
-	if (fd >= 0)
-		fchmod(fd, mode);
 	return fd;
 }