Skip to content
Snippets Groups Projects
Commit 13a07b99 authored by Peter Ganten's avatar Peter Ganten Committed by Alexandre Julliard
Browse files

Try to unlink output file before opening it.

parent 235d39cf
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@
#include <assert.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include "winnt.h"
#include "build.h"
......@@ -113,6 +114,11 @@ static void do_pic(void)
static void do_output( const char *arg )
{
if ( ( unlink ( arg ) ) == -1 && ( errno != ENOENT ) )
{
fprintf ( stderr, "Unable to create output file '%s'\n", arg );
exit (1);
}
if (!(output_file = fopen( arg, "w" )))
{
fprintf( stderr, "Unable to create output file '%s'\n", arg );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment