Skip to content

Commit

Permalink
Snapshot: Fix retained warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Goldfish64 committed Mar 7, 2025
1 parent 48f131d commit 4c5ac8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Tools/Daemons/hvsnapshotd/hvsnapshotd.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static bool isApfsSupported() {
return version[0] >= DARWIN_VERSION_HIGHSIERRA;
}

static CFStringRef getApfsDiskContainer(const char *diskPath) {
static CFStringRef apfsGetDiskContainer(const char *diskPath) __attribute__((cf_returns_retained)) {
DASessionRef session = NULL;
DADiskRef disk = NULL;
io_service_t media = IO_OBJECT_NULL;
Expand Down Expand Up @@ -230,7 +230,7 @@ static IOReturn freezeThawMountedFilesystems(UInt32 type) {
strncpy(apfsContainerMappings[i].apfsDevPath, mountList[i].f_mntfromname, sizeof (apfsContainerMappings[i].apfsDevPath) - 1);
apfsContainerMappings[i].apfsDevPath[sizeof (apfsContainerMappings[i].apfsDevPath) - 1] = '\0';

apfsContainerStr = getApfsDiskContainer(mountList[i].f_mntfromname);
apfsContainerStr = apfsGetDiskContainer(mountList[i].f_mntfromname);
if (apfsContainerStr == NULL) {
HVSYSLOG(stderr, "Failed to get container for APFS volume '%s'", mountList[i].f_mntfromname);
free(apfsContainerMappings);
Expand Down

0 comments on commit 4c5ac8f

Please sign in to comment.