Skip to content

Commit

Permalink
use creat() instead of open()
Browse files Browse the repository at this point in the history
  • Loading branch information
tjko committed Jan 24, 2025
1 parent 4c8df05 commit 93fa6d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ FILE* create_file(const char *name)
if (!name)
return NULL;

if ((fd = open(name, (O_WRONLY | O_CREAT | O_TRUNC), (S_IWUSR | S_IRUSR))) < 0)
if ((fd = creat(name, S_IWUSR | S_IRUSR)) < 0)
return NULL;
if (!(f = fdopen(fd, "wb"))) {
close(fd);
Expand Down

0 comments on commit 93fa6d5

Please sign in to comment.