From 439875c1d9773df06cabbe9611f7a67c88f58847 Mon Sep 17 00:00:00 2001 From: Daniel Lundqvist Date: Tue, 4 Oct 2016 10:53:19 +0200 Subject: [PATCH] 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 Signed-off-by: H. Peter Anvin --- rdoff/ldrdf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; }