aboutsummaryrefslogtreecommitdiffstats
path: root/rdoff
diff options
context:
space:
mode:
authorDaniel Lundqvist <daniel@malarhojden.nu>2016-10-04 10:53:19 +0200
committerH. Peter Anvin <hpa@zytor.com>2016-10-04 03:36:27 -0700
commit439875c1d9773df06cabbe9611f7a67c88f58847 (patch)
treea692da8d911ad69f4682a81a6a0a614a6a3ca4e7 /rdoff
parentce63783e85d79d8d21582c3458e2d7c7f8b77802 (diff)
downloadnasm-439875c1d9773df06cabbe9611f7a67c88f58847.tar.gz
nasm-439875c1d9773df06cabbe9611f7a67c88f58847.tar.xz
nasm-439875c1d9773df06cabbe9611f7a67c88f58847.zip
ldrdf: Remove output file if there are any errors
If there are any errors while linking, we should not create an output file. Signed-off-by: Daniel Lundqvist <daniel@malarhojden.nu> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'rdoff')
-rw-r--r--rdoff/ldrdf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/rdoff/ldrdf.c b/rdoff/ldrdf.c
index ff543f93..2db980f0 100644
--- a/rdoff/ldrdf.c
+++ b/rdoff/ldrdf.c
@@ -1398,7 +1398,9 @@ int main(int argc, char **argv)
write_output(outname);
- if (errorcount > 0)
+ if (errorcount > 0) {
+ remove(outname);
exit(1);
+ }
return 0;
}