mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-11-25 18:31:14 +00:00
Create files according to the process umask.
This commit is contained in:
parent
2666bef882
commit
e933e7885f
@ -581,7 +581,7 @@ static void create_volume_ok(GtkWidget *button, file_req_assoc *assoc)
|
|||||||
delete assoc;
|
delete assoc;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int fd = open(file, O_CREAT | O_WRONLY | O_EXCL, S_IRUSR | S_IWUSR);
|
int fd = open(file, O_CREAT | O_WRONLY | O_EXCL, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
|
||||||
if (fd < 0 && errno == EEXIST) {
|
if (fd < 0 && errno == EEXIST) {
|
||||||
printf("File already exists, refusing to overwrite file.\n");
|
printf("File already exists, refusing to overwrite file.\n");
|
||||||
} else {
|
} else {
|
||||||
|
@ -510,7 +510,7 @@ static void create_volume_ok(GtkWidget *button, file_req_assoc *assoc)
|
|||||||
delete assoc;
|
delete assoc;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int fd = open(file, O_CREAT | O_WRONLY | O_EXCL, S_IRUSR | S_IWUSR);
|
int fd = open(file, O_CREAT | O_WRONLY | O_EXCL, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
|
||||||
if (fd < 0 && errno == EEXIST) {
|
if (fd < 0 && errno == EEXIST) {
|
||||||
printf("File already exists, refusing to overwrite file.\n");
|
printf("File already exists, refusing to overwrite file.\n");
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user