Added space reservation
This commit is contained in:
@@ -177,12 +177,13 @@ result_t import_backing(char** _backing, const char* disk) {
|
||||
|
||||
if (info.backing_path != NULL) {
|
||||
// Get the backing identifier of the parent
|
||||
errno = 0;
|
||||
char* backing = strdup(basename(info.backing_path));
|
||||
if (backing == NULL) {
|
||||
free_disk_info(&info);
|
||||
remove(temp_path);
|
||||
free(temp_path);
|
||||
return failure("Failed to get the backing identifier of the parent.");
|
||||
return failure("Failed to get the backing identifier of the parent of '%s' (%s).", disk, strerror(errno));
|
||||
}
|
||||
|
||||
// Check that the backing exists
|
||||
@@ -406,13 +407,14 @@ result_t get_backing_parent(char** _parent, const char* backing) {
|
||||
}
|
||||
|
||||
// Get the backing identifier of the parent
|
||||
errno = 0;
|
||||
char* parent = strdup(basename(info.backing_path));
|
||||
|
||||
// Free the disk info as it is not needed anymore
|
||||
free_disk_info(&info);
|
||||
|
||||
if (parent == NULL)
|
||||
return failure("Failed to get the backing identifier of the parent.");
|
||||
return failure("Failed to get the backing identifier of the parent of '%s' (%s).", backing, strerror(errno));
|
||||
|
||||
*_parent = parent;
|
||||
return success();
|
||||
|
Reference in New Issue
Block a user