/*
- * 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@
*
__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 */
}
*/
__SCDynamicStoreUnlock(store, TRUE);
- return kSCStatusOK;
+ return sc_status;
}
)
{
CFStringRef key = NULL; /* key (un-serialized) */
- serverSessionRef mySession = getSession(server);
+ serverSessionRef mySession;
/* un-serialize the key */
if (!_SCUnserializeString(&key, NULL, (void *)keyRef, keyLen)) {
goto done;
}
- if (!mySession) {
+ mySession = getSession(server);
+ if (mySession == NULL) {
*sc_status = kSCStatusNoStoreSession; /* you must have an open session to play */
goto done;
}