close(fd);
return -1;
}
- fd2 = open(pathname, O_CREAT | O_WRONLY, 0777); // Directory where file is required should be created already.
+ fd2 = open(pathname, O_CREAT | O_WRONLY, S_IRWXU); // Directory where file is required should be created already.
if (fd2 < 0) {
LOG("can't open file(%s).\n", pathname);
SS_Free(buf);
close(fd);
return -1;
}
- fd2 = open(pathname, O_CREAT | O_WRONLY, 0777); // Directory where file is required should be created already.
+ fd2 = open(pathname, O_CREAT | O_WRONLY, S_IRWXU); // Directory where file is required should be created already.
if (fd2 < 0) {
LOG("can't open file(%s).\n", pathname);
SS_Free(buf);