]> git.saurik.com Git - apple/configd.git/blobdiff - SystemConfiguration.fproj/SCDNotifierGetChanges.c
configd-453.16.tar.gz
[apple/configd.git] / SystemConfiguration.fproj / SCDNotifierGetChanges.c
index bbfe5e4a6e0a86702c1aef9a88b92f018cfdfc78..cb8b7cc9ccee2829b2e38a3bdbae271d7c060e38 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2001, 2003-2005, 2009, 2010 Apple Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2003-2005, 2009-2011 Apple Inc. All rights reserved.
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
@@ -68,21 +68,11 @@ SCDynamicStoreCopyNotifiedKeys(SCDynamicStoreRef store)
                               &xmlDataLen,
                               (int *)&sc_status);
 
-       if (status != KERN_SUCCESS) {
-               if ((status == MACH_SEND_INVALID_DEST) || (status == MIG_SERVER_DIED)) {
-                       /* the server's gone and our session port's dead, remove the dead name right */
-                       (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
-               } else {
-                       /* we got an unexpected error, leave the [session] port alone */
-                       SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreCopyNotifiedKeys notifychanges(): %s"), mach_error_string(status));
-               }
-               storePrivate->server = MACH_PORT_NULL;
-               if ((status == MACH_SEND_INVALID_DEST) || (status == MIG_SERVER_DIED)) {
-                       if (__SCDynamicStoreReconnect(store)) {
-                               goto retry;
-                       }
-               }
-               sc_status = status;
+       if (__SCDynamicStoreCheckRetryAndHandleError(store,
+                                                    status,
+                                                    &sc_status,
+                                                    "SCDynamicStoreCopyNotifiedKeys notifychanges()")) {
+               goto retry;
        }
 
        if (sc_status != kSCStatusOK) {