diff options
author | Ingo Huerner <ingo_huerner@mentor.com> | 2015-05-07 17:57:59 +0200 |
---|---|---|
committer | Ingo Huerner <ingo_huerner@mentor.com> | 2015-05-07 17:57:59 +0200 |
commit | f64412a688e9dfd8e0ced460168fd9d4e3539ff2 (patch) | |
tree | 7e1a74701fc93a768af05e2951c6188a8be3e792 | |
parent | 10de54dcd68ca69da6ac7b504ac344678c3911be (diff) | |
download | persistence-client-library-f64412a688e9dfd8e0ced460168fd9d4e3539ff2.tar.gz |
Updated header documentation; fixed a problem when dbus connection is NULL
-rw-r--r-- | include/persistence_client_library.h | 4 | ||||
-rw-r--r-- | include/persistence_client_library_key.h | 8 | ||||
-rw-r--r-- | src/persistence_client_library_dbus_service.c | 7 |
3 files changed, 14 insertions, 5 deletions
diff --git a/include/persistence_client_library.h b/include/persistence_client_library.h index ce37173..117f62f 100644 --- a/include/persistence_client_library.h +++ b/include/persistence_client_library.h @@ -219,8 +219,7 @@ extern "C" { * * @return positive value: success; * On error a negative value will be returned with the following error codes: - * ::EPERS_NOT_INITIALIZED, ::EPERS_DBUS_MAINLOOP, - * ::EPERS_REGISTER_LIFECYCLE, ::EPERS_REGISTER_ADMIN + * ::EPERS_DBUS_MAINLOOP, ::EPERS_REGISTER_LIFECYCLE, ::EPERS_REGISTER_ADMIN * - since V1.3.1: ::EPERS_NOPRCTABLE: the application (folder) is not or incorrectly installed * - since V1.4.1: ::EPERS_INVALID_ARGUMENT: invalid argument provided */ @@ -240,6 +239,7 @@ int pclInitLibrary(const char* appname, int shutdownMode); * * @return positive value: success; * On error a negative value will be returned. + * ::EPERS_NOT_INITIALIZED */ int pclDeinitLibrary(void); diff --git a/include/persistence_client_library_key.h b/include/persistence_client_library_key.h index 37de33e..8493103 100644 --- a/include/persistence_client_library_key.h +++ b/include/persistence_client_library_key.h @@ -222,7 +222,7 @@ int pclKeyHandleUnRegisterNotifyOnChange(int key_handle, pclChangeNotifyCallback * @return positive value (0 or greater): the bytes written; * On error a negative value will be returned with the following error codes: * ::EPERS_LOCKFS ::EPERS_MAX_BUFF_SIZE ::EPERS_NOTIFY_SIG ::EPERS_DB_VALUE_SIZE ::EPERS_DB_KEY_SIZE - * ::EPERS_NOPRCTABLE ::EPERS_DB_VALUE_SIZE ::EPERS_RESOURCE_READ_ONLY + * ::EPERS_NOPRCTABLE ::EPERS_DB_VALUE_SIZE ::EPERS_RESOURCE_READ_ONLY ::EPERS_SHUTDOWN_NO_TRUSTED ::EPERS_COMMON ::EPERS_NOT_INITIALIZED */ int pclKeyHandleWriteData(int key_handle, unsigned char* buffer, int buffer_size); @@ -240,7 +240,9 @@ int pclKeyHandleWriteData(int key_handle, unsigned char* buffer, int buffer_size * * @return positive value (0 or greater): the bytes read; * On error a negative value will be returned with th following error codes: - * ::EPERS_LOCKFS ::EPERS_NOT_INITIALIZED ::EPERS_BADPOL ::EPERS_NOPLUGINFUNCT + * ::EPERS_LOCKFS ::EPERS_NOT_INITIALIZED ::EPERS_BADPOL ::EPERS_NOPLUGINFUNCT ::EPERS_SHUTDOWN_NO_TRUSTED + * ::EPERS_COMMON + * */ int pclKeyReadData(unsigned int ldbid, const char* resource_id, unsigned int user_no, unsigned int seat_no, unsigned char* buffer, int buffer_size); @@ -299,7 +301,7 @@ int pclKeyUnRegisterNotifyOnChange( unsigned int ldbid, const char * resource_ * @return positive value (0 or greater): the bytes written; * On error a negative value will be returned with the following error codes: * ::EPERS_LOCKFS ::EPERS_BADPOL ::EPERS_BUFLIMIT ::EPERS_DB_VALUE_SIZE ::EPERS_DB_KEY_SIZE - * ::EPERS_NOTIFY_SIG ::EPERS_RESOURCE_READ_ONLY ::EPERS_NOT_RESP_APP + * ::EPERS_NOTIFY_SIG ::EPERS_RESOURCE_READ_ONLY ::EPERS_NOT_RESP_APP ::EPERS_SHUTDOWN_NO_TRUSTED */ int pclKeyWriteData(unsigned int ldbid, const char* resource_id, unsigned int user_no, unsigned int seat_no, unsigned char* buffer, int buffer_size); diff --git a/src/persistence_client_library_dbus_service.c b/src/persistence_client_library_dbus_service.c index 281dd2e..2e431a2 100644 --- a/src/persistence_client_library_dbus_service.c +++ b/src/persistence_client_library_dbus_service.c @@ -392,6 +392,13 @@ int setup_dbus_mainloop(void) { DLT_LOG(gPclDLTContext, DLT_LOG_DEBUG, DLT_STRING("setupMainLoop - Use def bus (DBUS_BUS_SYSTEM)")); conn = dbus_bus_get_private(DBUS_BUS_SYSTEM, &err); + + if(conn == NULL) + { + DLT_LOG(gPclDLTContext, DLT_LOG_ERROR, DLT_STRING("setupMainLoop - get_private() :"), DLT_STRING(err.message) ); + dbus_error_free(&err); + return EPERS_COMMON; + } } if (-1 == (pipe(gPipeFd))) // create communication pipe with the dbus mainloop |