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.
This commit is contained in:
Linus Torvalds 2005-04-17 09:55:36 -07:00
Родитель c4e3cca1f7
Коммит fa06d442c6
1 изменённых файлов: 1 добавлений и 3 удалений

Просмотреть файл

@ -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;
}