Added some small modifications
This commit is contained in:
@@ -68,3 +68,18 @@ Status GetBackingDiskPath(const char* backing_identifier, char** _backing_path)
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
Status DoesBackingExist(const char* backing_identifier, bool* _result) {
|
||||
// Get the backing path
|
||||
char* backing_path = NULL;
|
||||
Status status = GetBackingDiskPath(backing_identifier, &backing_path);
|
||||
if (status != SUCCESS)
|
||||
return status;
|
||||
|
||||
// Check if the backing exists and is a regular file
|
||||
struct stat st;
|
||||
*_result = stat(backing_path, &st) == 0 && S_ISREG(st.st_mode);
|
||||
free(backing_path);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
Reference in New Issue
Block a user