* @exception #NOTIFICATION_ERROR_NONE Success
* @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
* @exception #NOTIFICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @exception #NOTIFICATION_ERROR_IO_ERROR I/O error
* @see #notification_type_e
* @par Sample code:
* @code
char *app_root_path = NULL;
char locale_directory[PATH_MAX] = { 0, }; /* PATH_MAX 4096 */
char pkg_id[NOTI_PKG_ID_LEN + 1] = { 0, };
- int err;
+ int err = 0;
if (type <= NOTIFICATION_TYPE_NONE || type > NOTIFICATION_TYPE_MAX) {
NOTIFICATION_ERR("Invalid notification type[%d]", type);
noti->caller_app_id = notification_get_app_id_by_pid(getpid());
if (noti->caller_app_id == NULL) {
NOTIFICATION_ERR("Failed to get caller_app_id");
+ err = -1;
goto out;
}
if (package_info)
package_info_destroy(package_info);
+ if (err != 0) {
+ notification_free(noti);
+ noti = NULL;
+ set_last_result(NOTIFICATION_ERROR_IO_ERROR);
+ } else {
+ set_last_result(NOTIFICATION_ERROR_NONE);
+ }
+
/*!
* \NOTE
* Other fields are already initialized with ZERO.
*/
- set_last_result(NOTIFICATION_ERROR_NONE);
+
return noti;
}