diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-17 09:55:36 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-17 09:55:36 -0700 |
commit | fa06d442c6c5113fcff9991f349157bdb0c4b989 (patch) | |
tree | aadcae71d6f2b24b78822cc077c012febee593ea /checkout-cache.c | |
parent | c4e3cca1f71d34e69bdbfa0de0144ddb00f75505 (diff) | |
download | git-fa06d442c6c5113fcff9991f349157bdb0c4b989.tar.gz git-fa06d442c6c5113fcff9991f349157bdb0c4b989.tar.xz |
Fix total permission bogosity in "checkout-cache.c".
Use the proper octal mode naming instead of random decimal
crud, and don't reset the mode after the create with fchmod:
the whole point was to let "umask" do its thing.
Duh.
Diffstat (limited to 'checkout-cache.c')
-rw-r--r-- | checkout-cache.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/checkout-cache.c b/checkout-cache.c index 09b36b9c7..b909f5d9a 100644 --- a/checkout-cache.c +++ b/checkout-cache.c @@ -54,7 +54,7 @@ static int create_file(const char *path, unsigned int mode) { int fd; - mode = (mode & 0100) ? 777 : 666; + mode = (mode & 0100) ? 0777 : 0666; fd = open(path, O_WRONLY | O_TRUNC | O_CREAT, mode); if (fd < 0) { if (errno == ENOENT) { @@ -62,8 +62,6 @@ static int create_file(const char *path, unsigned int mode) fd = open(path, O_WRONLY | O_TRUNC | O_CREAT, mode); } } - if (fd >= 0) - fchmod(fd, mode); return fd; } |