Skip to content

Commit

Permalink
Truncate
Browse files Browse the repository at this point in the history
  • Loading branch information
tyfkda committed May 3, 2024
1 parent 5dc8665 commit a561429
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ld/ld.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ static bool output_exe(const char *ofn, uintptr_t entry_address) {
fp = stdout;
} else {
const int mod = S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; // 0755
const int flag = O_WRONLY | O_CREAT;
const int flag = O_WRONLY | O_CREAT | O_TRUNC;
int fd = open(ofn, flag, mod);
if (fd < 0) {
perror("open failed");
Expand Down

0 comments on commit a561429

Please sign in to comment.