diff options
| author | Changming Xu <xcmhit@gmail.com> | 2011-03-03 21:09:18 +0800 |
|---|---|---|
| committer | Changming Xu <xcmhit@gmail.com> | 2011-03-03 21:09:18 +0800 |
| commit | c27e76aa2aa6dce1c5a0409ba97e2c7ef313aa33 (patch) | |
| tree | e7899d197b003772b1d7787d255dfd0b86de4648 /tccelf.c | |
| parent | c93eca4fe490b0122a9b3a0eb9d280a998bc3054 (diff) | |
| download | tinycc-c27e76aa2aa6dce1c5a0409ba97e2c7ef313aa33.tar.gz tinycc-c27e76aa2aa6dce1c5a0409ba97e2c7ef313aa33.tar.bz2 | |
unlink outfile first
file mode problem if the outfile already exists
Diffstat (limited to 'tccelf.c')
| -rw-r--r-- | tccelf.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -2086,6 +2086,7 @@ static int elf_output_file(TCCState *s1, const char *filename) mode = 0666; else mode = 0777; + unlink(filename); fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, mode); if (fd < 0) { error_noabort("could not write '%s'", filename); |
