int ret;
int i = 0;
int j = 0;
+ int len = 0;
if (appid == NULL)
return ERR_ALARM_INVALID_PARAM;
return ret;
memset(service_name_mod, 'a', MAX_SERVICE_NAME_LEN-1);
- strncpy(service_name, appid, MAX_PKG_NAME_LEN);
+
+ len = strlen("ALARM.");
+ strncpy(service_name, "ALARM.", len);
+ strncpy(service_name + len, appid, strlen(appid));
j=0;
j++;
}
- strncat(service_name, ".ALARM", strlen(".ALARM"));
-
- strncat(service_name_mod, ".ALARM", strlen(".ALARM"));
-
+ ALARM_MGR_LOG_PRINT("[alarm-lib]: service_name %s\n", service_name);
+ ALARM_MGR_LOG_PRINT("[alarm-lib]: service_name_mod %s\n", service_name_mod);
dbus_error_init(&derror);
if (destination != NULL) {
memset(dst_service_name, 0,
- strlen(destination) + strlen(".ALARM") + 2);
- snprintf(dst_service_name, MAX_SERVICE_NAME_LEN, "%s",
+ strlen(destination) + strlen("ALARM.") + 2);
+ snprintf(dst_service_name, MAX_SERVICE_NAME_LEN, "ALARM.%s",
destination);
memset(dst_service_name_mod,'a',MAX_SERVICE_NAME_LEN-1);
j++;
}
- strncat(dst_service_name, ".ALARM", strlen(".ALARM"));
- strncat(dst_service_name_mod, ".ALARM", strlen(".ALARM"));
-
if (!_send_alarm_create
(alarm_context, alarm_info, alarm_id, dst_service_name, dst_service_name_mod,
&error_code)) {
if (destination != NULL) {
memset(dst_service_name, 0,
- strlen(destination) + strlen(".ALARM") + 2);
- snprintf(dst_service_name, MAX_SERVICE_NAME_LEN, "%s",
+ strlen(destination) + strlen("ALARM.") + 2);
+ snprintf(dst_service_name, MAX_SERVICE_NAME_LEN, "ALARM.%s",
destination);
memset(dst_service_name_mod,'a',MAX_SERVICE_NAME_LEN-1);
j++;
}
- strncat(dst_service_name, ".ALARM", strlen(".ALARM"));
- strncat(dst_service_name_mod, ".ALARM", strlen(".ALARM"));
-
if (!_send_alarm_create
(alarm_context, &alarm_info, alarm_id, dst_service_name,dst_service_name_mod,
&error_code)) {
if (ret < 0)
return ret;
- ALARM_MGR_LOG_PRINT("[alarm-lib]:alarm_delete() is called\n");
+ ALARM_MGR_LOG_PRINT("[alarm-lib]:alarm_delete(%d) is called\n", alarm_id);
if (alarm_id <= 0) {
return ERR_ALARM_INVALID_ID;
if (destination != NULL) {
memset(dst_service_name, 0,
- strlen(destination) + strlen(".ALARM") + 2);
- snprintf(dst_service_name, MAX_SERVICE_NAME_LEN, "%s.ALARM",
+ strlen(destination) + strlen("ALARM.") + 2);
+ snprintf(dst_service_name, MAX_SERVICE_NAME_LEN, "ALARM.%s",
destination);
if (!_send_alarm_create
(alarm_context, alarm_info, alarm_id, dst_service_name,"null",