mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zipl: clean up temporary bootmap file in case of error
zipl creates a temp bootmap file to keep the original file in case of an error. Delete this temp file in case of an error. Signed-off-by: Stefan Haberland <sth@linux.ibm.com> Reviewed-by: Philipp Rudo <prudo@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
6f9337d101
commit
27a6409a4a
@@ -1286,9 +1286,7 @@ bootmap_create(struct job_data *job, disk_blockptr_t *program_table,
|
||||
break;
|
||||
}
|
||||
if (dry_run) {
|
||||
if (remove(filename) == -1)
|
||||
fprintf(stderr, "Warning: could not remove temporary "
|
||||
"file %s!\n", filename);
|
||||
misc_free_temp_file(filename);
|
||||
} else if (job->id != job_dump_partition) {
|
||||
/* Rename to final bootmap name */
|
||||
mapname = misc_make_path(job->target.bootmap_dir,
|
||||
@@ -1315,6 +1313,8 @@ out_disk_free_info:
|
||||
disk_free_info(info);
|
||||
out_close_fd:
|
||||
close(fd);
|
||||
if (job->id != job_dump_partition)
|
||||
misc_free_temp_file(filename);
|
||||
out_free_filename:
|
||||
free(filename);
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user