X-Git-Url: https://git.saurik.com/apple/configd.git/blobdiff_plain/1ef45fa40afc16a8d224b7438ecefbd7c8b4fbfe..HEAD:/configd.tproj/_snapshot.c diff --git a/configd.tproj/_snapshot.c b/configd.tproj/_snapshot.c index 2874345..854d36c 100644 --- a/configd.tproj/_snapshot.c +++ b/configd.tproj/_snapshot.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2006, 2009-2011, 2015, 2017 Apple Inc. All rights reserved. + * Copyright (c) 2000-2006, 2009-2011, 2015, 2018, 2019 Apple Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * @@ -44,7 +44,6 @@ #define SNAPSHOT_PATH_STATE _PATH_VARTMP "configd-state" #define SNAPSHOT_PATH_STORE _PATH_VARTMP "configd-store.plist" #define SNAPSHOT_PATH_PATTERN _PATH_VARTMP "configd-pattern.plist" -#define SNAPSHOT_PATH_SESSION _PATH_VARTMP "configd-session.plist" #define N_QUICK 100 @@ -70,7 +69,7 @@ _expandStore(CFDictionaryRef storeData) oValues = CFAllocatorAllocate(NULL, nElements * sizeof(CFTypeRef), 0); nValues = CFAllocatorAllocate(NULL, nElements * sizeof(CFTypeRef), 0); } - bzero(nValues, nElements * sizeof(CFTypeRef)); + memset(nValues, 0, nElements * sizeof(CFTypeRef)); CFDictionaryGetKeysAndValues(storeData, keys, oValues); for (i = 0; i < nElements; i++) { @@ -143,12 +142,8 @@ __SCDynamicStoreSnapshot(SCDynamicStoreRef store) if (f == NULL) { return kSCStatusFailed; } - SCPrint(TRUE, f, CFSTR("Main thread :\n\n")); + SCPrint(TRUE, f, CFSTR("Main [plug-in] thread :\n\n")); SCPrint(TRUE, f, CFSTR("%@\n"), CFRunLoopGetCurrent()); - if (plugin_runLoop != NULL) { - SCPrint(TRUE, f, CFSTR("Plug-in thread :\n\n")); - SCPrint(TRUE, f, CFSTR("%@\n"), plugin_runLoop); - } listSessions(f); (void) fclose(f); @@ -190,24 +185,6 @@ __SCDynamicStoreSnapshot(SCDynamicStoreRef store) (void) close(fd); CFRelease(xmlData); - /* Save a snapshot of the "session" data */ - - (void) unlink(SNAPSHOT_PATH_SESSION); - fd = open(SNAPSHOT_PATH_SESSION, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL, 0644); - if (fd == -1) { - return kSCStatusFailed; - } - - xmlData = CFPropertyListCreateData(NULL, sessionData, kCFPropertyListXMLFormat_v1_0, 0, NULL); - if (xmlData == NULL) { - SC_log(LOG_NOTICE, "CFPropertyListCreateData() failed"); - close(fd); - return kSCStatusFailed; - } - (void) write(fd, CFDataGetBytePtr(xmlData), CFDataGetLength(xmlData)); - (void) close(fd); - CFRelease(xmlData); - return kSCStatusOK; }