Don't try to delete the output file if we don't know its name yet.
This commit is contained in:
parent
ef04e3921e
commit
2d6840917d
|
@ -47,7 +47,7 @@ const char* program_name;
|
|||
void
|
||||
gold_exit(bool status)
|
||||
{
|
||||
if (!status && parameters != NULL)
|
||||
if (!status && parameters != NULL && parameters->options_valid())
|
||||
unlink_if_ordinary(parameters->output_file_name());
|
||||
exit(status ? EXIT_SUCCESS : EXIT_FAILURE);
|
||||
}
|
||||
|
|
|
@ -47,6 +47,12 @@ class Parameters
|
|||
errors() const
|
||||
{ return this->errors_; }
|
||||
|
||||
// Whether the options are valid. This should not normally be
|
||||
// called, but it is needed by gold_exit.
|
||||
bool
|
||||
options_valid() const
|
||||
{ return this->options_valid_; }
|
||||
|
||||
// Whether to use threads.
|
||||
bool
|
||||
threads() const
|
||||
|
|
Loading…
Reference in New Issue