Commit afd7dc59 authored by Tijl Coosemans's avatar Tijl Coosemans Committed by Alexandre Julliard

winebuild: Don't register cleanup function when --save-temps is passed after --output.

parent db92670f
......@@ -250,6 +250,7 @@ extern char *find_tool( const char *name, const char * const *names );
extern struct strarray *get_as_command(void);
extern struct strarray *get_ld_command(void);
extern const char *get_nm_command(void);
extern void cleanup_tmp_files(void);
extern char *get_temp_file_name( const char *prefix, const char *suffix );
extern void output_standard_file_header(void);
extern FILE *open_input_file( const char *srcdir, const char *name );
......@@ -347,7 +348,6 @@ extern int nb_errors;
extern int display_warnings;
extern int kill_at;
extern int verbose;
extern int save_temps;
extern int link_ext_symbols;
extern int force_pointer_size;
extern int unwind_tables;
......
......@@ -44,7 +44,6 @@ int nb_errors = 0;
int display_warnings = 0;
int kill_at = 0;
int verbose = 0;
int save_temps = 0;
int link_ext_symbols = 0;
int force_pointer_size = 0;
int unwind_tables = 0;
......@@ -358,6 +357,7 @@ static char **parse_options( int argc, char **argv, DLLSPEC *spec )
{
char *p;
int optc;
int save_temps = 0;
while ((optc = getopt_long( argc, argv, short_options, long_options, NULL )) != -1)
{
......@@ -515,6 +515,8 @@ static char **parse_options( int argc, char **argv, DLLSPEC *spec )
}
}
if (!save_temps) atexit( cleanup_tmp_files );
if (spec->file_name && !strchr( spec->file_name, '.' ))
strcat( spec->file_name, exec_mode == MODE_EXE ? ".exe" : ".dll" );
init_dll_name( spec );
......
......@@ -64,7 +64,7 @@ static const struct
};
/* atexit handler to clean tmp files */
static void cleanup_tmp_files(void)
void cleanup_tmp_files(void)
{
unsigned int i;
for (i = 0; i < nb_tmp_files; i++) if (tmp_files[i]) unlink( tmp_files[i] );
......@@ -461,8 +461,6 @@ char *get_temp_file_name( const char *prefix, const char *suffix )
const char *ext, *basename;
int fd;
if (!nb_tmp_files && !save_temps) atexit( cleanup_tmp_files );
if (!prefix || !prefix[0]) prefix = "winebuild";
if (!suffix) suffix = "";
if ((basename = strrchr( prefix, '/' ))) basename++;
......
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