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:
Stefan Haberland
2019-11-20 15:30:12 +01:00
committed by Jan Höppner
parent 6f9337d101
commit 27a6409a4a
3 changed files with 14 additions and 3 deletions
+10
View File
@@ -366,6 +366,16 @@ misc_free_temp_dev(char* device)
free(device);
}
/* Delete temporary bootmap file */
void
misc_free_temp_file(char *filename)
{
if (remove(filename)) {
fprintf(stderr,
"Warning: Could not remove temporary file %s: %s",
filename, strerror(errno));
}
}
/* Write COUNT bytes from memory at location DATA to the file identified by
* file descriptor FD. Return 0 when all bytes were successfully written,