]> git.saurik.com Git - apple/configd.git/blobdiff - configd.tproj/_configtouch.c
configd-293.8.tar.gz
[apple/configd.git] / configd.tproj / _configtouch.c
index d35842085189f1f1599e436ab3aab156bace4a7a..fb301310330a580afd0bff7e064974d8ac69f504 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2004, 2006, 2008, 2009 Apple Inc. All rights reserved.
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
@@ -39,10 +39,10 @@ int
 __SCDynamicStoreTouchValue(SCDynamicStoreRef store, CFStringRef key)
 {
        SCDynamicStorePrivateRef        storePrivate    = (SCDynamicStorePrivateRef)store;
-       int                             sc_status;
+       int                             sc_status       = kSCStatusOK;
        CFDataRef                       value;
 
-       if (!store || (storePrivate->server == MACH_PORT_NULL)) {
+       if ((store == NULL) || (storePrivate->server == MACH_PORT_NULL)) {
                return kSCStatusNoStoreSession; /* you must have an open session to play */
        }
 
@@ -105,7 +105,7 @@ __SCDynamicStoreTouchValue(SCDynamicStoreRef store, CFStringRef key)
         */
        __SCDynamicStoreUnlock(store, TRUE);
 
-       return kSCStatusOK;
+       return sc_status;
 }
 
 
@@ -118,7 +118,7 @@ _configtouch(mach_port_t            server,
 )
 {
        CFStringRef             key             = NULL;         /* key  (un-serialized) */
-       serverSessionRef        mySession       = getSession(server);
+       serverSessionRef        mySession;
 
        /* un-serialize the key */
        if (!_SCUnserializeString(&key, NULL, (void *)keyRef, keyLen)) {
@@ -131,7 +131,8 @@ _configtouch(mach_port_t            server,
                goto done;
        }
 
-       if (!mySession) {
+       mySession = getSession(server);
+       if (mySession == NULL) {
                *sc_status = kSCStatusNoStoreSession;   /* you must have an open session to play */
                goto done;
        }