Commit 13a07b99 authored by Peter Ganten's avatar Peter Ganten Committed by Alexandre Julliard

Try to unlink output file before opening it.

parent 235d39cf
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h>
#include "winnt.h" #include "winnt.h"
#include "build.h" #include "build.h"
...@@ -113,6 +114,11 @@ static void do_pic(void) ...@@ -113,6 +114,11 @@ static void do_pic(void)
static void do_output( const char *arg ) 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" ))) if (!(output_file = fopen( arg, "w" )))
{ {
fprintf( stderr, "Unable to create output file '%s'\n", arg ); fprintf( stderr, "Unable to create output file '%s'\n", arg );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment