// create thread here ( getting event_socket )
if (pthread_create(&g_adaptor_event_thread_pid, NULL,
__bookmark_adaptor_event_manager, g_adaptorinfo) != 0) {
- TRACE_STRERROR("[CRITICAL] pthread_create");
+ TRACE_ERROR("[CRITICAL] pthread_create");
return -1;
}
pthread_detach(g_adaptor_event_thread_pid);
struct timeval tv_timeo = { 3, 500000 }; //3.5 second
if (setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, &tv_timeo,
sizeof( tv_timeo ) ) < 0) {
- TRACE_STRERROR("[CRITICAL] setsockopt SO_RCVTIMEO");
+ TRACE_ERROR("[CRITICAL] setsockopt SO_RCVTIMEO");
close(sockfd);
return -1;
}
ipcinfo->cmd_socket = __adaptor_create_socket();
}
if (ipcinfo->cmd_socket < 0) {
- TRACE_STRERROR("[CRITICAL] connect system error");
+ TRACE_ERROR("[CRITICAL] connect system error");
free(ipcinfo);
ipcinfo = NULL;
return -1;
int value = -1;
ssize_t recv_bytes = read(fd, &value, sizeof(int));
if (recv_bytes < 0) {
- TRACE_STRERROR("[CRITICAL] read");
+ TRACE_ERROR("[CRITICAL] read");
return -1;
}
return value;
if (ids_count > 0) {
idlist = (int *)calloc(ids_count, sizeof(int));
if (idlist == NULL) {
- TRACE_STRERROR("[CRITICAL] allocation");
+ TRACE_ERROR("[CRITICAL] allocation");
*errorcode = BP_ERROR_OUT_OF_MEMORY;
BP_PRINT_ERROR(cmd->id, *errorcode);
return -1;
ret = snprintf(proc_path, buf_size, "/proc/%d/cmdline", getpid());
if (ret < 0) {
- TRACE_STRERROR("failed to make cmdline path");
+ TRACE_ERROR("failed to make cmdline path");
return NULL;
}
fd = open(proc_path, O_RDONLY, 0600);
if (fd < 0) {
- TRACE_STRERROR("open cmdline:%s", proc_path);
+ TRACE_ERROR("open cmdline:%s", proc_path);
return NULL;
}
ret = read(fd, proc_path, buf_size - 1);
close(fd);
if (ret <= 0) {
- TRACE_STRERROR("read cmdline:%s", proc_path);
+ TRACE_ERROR("read cmdline:%s", proc_path);
return NULL;
}
proc_path[ret] = 0;
{
if (tid != NULL && (*tid > 0 && pthread_kill(*tid, 0) != ESRCH)) {
if (pthread_cancel(*tid) != 0) {
- TRACE_STRERROR("pthread:%0x", (int)*tid);
+ TRACE_ERROR("pthread:%0x", (int)*tid);
}
*tid = 0;
}
TRACE_DEBUG("[CLEAN] garbage packet[%ld]", length);
for (i = 0; i < length; i++) {
if (read(sock, &tmp_char, sizeof(char)) < 0) {
- TRACE_STRERROR("[CHECK] read");
+ TRACE_ERROR("[CHECK] read");
return -1;
}
}
TRACE_DEBUG("IPC ESTABILISH %s", notify_fifo);
adaptorinfo->notify = open(notify_fifo, O_RDONLY, 0600);
if (adaptorinfo->notify < 0) {
- TRACE_STRERROR("failed to ESTABILISH IPC %s", notify_fifo);
+ TRACE_ERROR("failed to ESTABILISH IPC %s", notify_fifo);
return -1;
}
// create thread here ( getting event_socket )
if (pthread_create(&g_adaptor_event_thread_pid, NULL,
__history_adaptor_event_manager, g_adaptorinfo) != 0) {
- TRACE_STRERROR("[CRITICAL] pthread_create");
+ TRACE_ERROR("[CRITICAL] pthread_create");
return -1;
}
pthread_detach(g_adaptor_event_thread_pid);
getbytes * sizeof(char));
getstr[getbytes] = '\0';
} else {
- TRACE_STRERROR("[CHECK] alloc for string");
+ TRACE_ERROR("[CHECK] alloc for string");
}
}
return getstr;
}
pid_t child_pid = 0;
if((child_pid = fork()) < 0 ) {
- TRACE_STRERROR("[ERROR] fock");
+ TRACE_ERROR("[ERROR] fock");
} else {
if(child_pid == 0) {
execl(tzplatform_mkpath(TZ_SYS_RO_APPS, "org.tizen.browser/bin/browser"),
tzplatform_mkpath(TZ_SYS_RO_APPS, "org.tizen.browser/bin/browser"),
"precaching", NULL);
- TRACE_STRERROR("[ERROR] execl browser precaching");
+ TRACE_ERROR("[ERROR] execl browser precaching");
exit(EXIT_SUCCESS);
}
}
size_t path_size = sizeof(NOTIFY_DIR) + 21;
char *notify_fifo = (char *)calloc(path_size, sizeof(char));
if (notify_fifo == NULL) {
- TRACE_STRERROR("failed to alocalte fifo path pid:%d", (int)pid);
+ TRACE_ERROR("failed to alocalte fifo path pid:%d", (int)pid);
return NULL;
}
if (snprintf(notify_fifo, path_size,"%s/%d", NOTIFY_DIR, pid) < 0) {
- TRACE_STRERROR("failed to make fifo path pid:%d", (int)pid);
+ TRACE_ERROR("failed to make fifo path pid:%d", (int)pid);
free(notify_fifo);
return NULL;
}
if (stat(notify_fifo, &fifo_state) == 0) // found
unlink(notify_fifo);
if (mkfifo(notify_fifo, 0644/*-rwrr*/) < 0) {
- TRACE_STRERROR("failed to make fifo %s", notify_fifo);
+ TRACE_ERROR("failed to make fifo %s", notify_fifo);
} else {
notify_fd = open(notify_fifo, O_RDWR | O_NONBLOCK, 0600);
}
eset = except_fdset;
if (select((maxfd + 1), &rset, 0, &eset, &timeout) < 0) {
- TRACE_STRERROR("[CRITICAL] select");
+ TRACE_ERROR("[CRITICAL] select");
break;
}
tv_timeo.tv_usec = 500000;
if (setsockopt(clientfd, SOL_SOCKET, SO_RCVTIMEO, &tv_timeo,
sizeof( tv_timeo ) ) < 0) {
- TRACE_STRERROR("[CRITICAL] setsockopt SO_SNDTIMEO");
+ TRACE_ERROR("[CRITICAL] setsockopt SO_SNDTIMEO");
close(clientfd);
continue;
}
(bp_client_defs *)calloc(1,
sizeof(bp_client_defs));
if (privates->slots[i].client == NULL) {
- TRACE_STRERROR("calloc, ignore this client");
+ TRACE_ERROR("calloc, ignore this client");
bp_ipc_send_errorcode(clientfd,
BP_ERROR_OUT_OF_MEMORY);
close(clientfd);
// make notify fifo
privates->slots[i].client->notify = bp_notify_init(cid);
if (privates->slots[i].client->notify < 0) {
- TRACE_STRERROR("failed to open fifo slot:%d", clientfd);
+ TRACE_ERROR("failed to open fifo slot:%d", clientfd);
bp_ipc_send_errorcode(clientfd, BP_ERROR_IO_ERROR);
bp_client_free(privates->slots[i].client);
privates->slots[i].client = NULL;
BP_CARE_CLIENT_MIN_INTERVAL) {
// this is error.
// terminate Process
- TRACE_STRERROR
+ TRACE_ERROR
("[CRITICAL] Sock exception prev[%ld]now[%ld][%ld]",
prev_timeout, now_timeout, flexible_timeout);
break;
BP_DB_COMMON_COL_IS_DELETED, cond2);
}
if (basic_cond == NULL) {
- TRACE_STRERROR("[ERROR] make query");
+ TRACE_ERROR("[ERROR] make query");
return BP_ERROR_OUT_OF_MEMORY;
}
if (is_like > 0) {
}
sqlite3_free(basic_cond);
if (conditions == NULL) {
- TRACE_STRERROR("[ERROR] make query");
+ TRACE_ERROR("[ERROR] make query");
return BP_ERROR_OUT_OF_MEMORY;
}
if (limit > 0 && errorcode == BP_ERROR_NONE) {
inquired_ids = (int *)calloc(limit, sizeof(int));
if (inquired_ids == NULL) {
- TRACE_STRERROR("[ERROR] allocation:%d", limit);
+ TRACE_ERROR("[ERROR] allocation:%d", limit);
errorcode = BP_ERROR_OUT_OF_MEMORY;
} else {
inquired_ids_count = bp_db_get_custom_bind_conds_ids(handle,
BP_DB_COMMON_COL_IS_DELETED, cond2);
}
if (basic_cond == NULL) {
- TRACE_STRERROR("[ERROR] make query");
+ TRACE_ERROR("[ERROR] make query");
return BP_ERROR_OUT_OF_MEMORY;
}
if (is_like > 0) {
}
sqlite3_free(basic_cond);
if (conditions == NULL) {
- TRACE_STRERROR("[ERROR] make query");
+ TRACE_ERROR("[ERROR] make query");
return BP_ERROR_OUT_OF_MEMORY;
}
if (limit > 0 && errorcode == BP_ERROR_NONE) {
inquired_ids = (int *)calloc(limit, sizeof(int));
if (inquired_ids == NULL) {
- TRACE_STRERROR("[ERROR] allocation:%d", limit);
+ TRACE_ERROR("[ERROR] allocation:%d", limit);
errorcode = BP_ERROR_OUT_OF_MEMORY;
} else {
inquired_ids_count = bp_db_get_custom_bind_conds_ids(handle,
BP_DB_COMMON_COL_IS_DELETED, cond2);
}
if (basic_cond == NULL) {
- TRACE_STRERROR("[ERROR] make query");
+ TRACE_ERROR("[ERROR] make query");
return BP_ERROR_OUT_OF_MEMORY;
}
if (is_like > 0) {
}
sqlite3_free(basic_cond);
if (conditions == NULL) {
- TRACE_STRERROR("[ERROR] make query");
+ TRACE_ERROR("[ERROR] make query");
return BP_ERROR_OUT_OF_MEMORY;
}
if (limit > 0 && errorcode == BP_ERROR_NONE) {
inquired_ids = (int *)calloc(limit, sizeof(int));
if (inquired_ids == NULL) {
- TRACE_STRERROR("[ERROR] allocation:%d", limit);
+ TRACE_ERROR("[ERROR] allocation:%d", limit);
errorcode = BP_ERROR_OUT_OF_MEMORY;
} else {
inquired_ids_count = bp_db_get_custom_bind_conds_ids(handle,
inquired_ids = (int *)calloc(limit, sizeof(int));
if (inquired_ids == NULL) {
- TRACE_STRERROR("[ERROR] allocation:%d", limit);
+ TRACE_ERROR("[ERROR] allocation:%d", limit);
return BP_ERROR_OUT_OF_MEMORY;
}
TRACE_SECURE_ERROR("failed to set smack label:%s", dirpath);
}
} else {
- TRACE_STRERROR("failed to create directory:%s", dirpath);
+ TRACE_ERROR("failed to create directory:%s", dirpath);
}
}
}
}
if (fd < 0 || write(fd, &errorcode, sizeof(bp_error_defs)) <= 0) {
- TRACE_STRERROR("[IPC.Write] exception sock:%d", fd);
+ TRACE_ERROR("[IPC.Write] exception sock:%d", fd);
return -1;
}
return 0;
}
if (fd < 0 || write(fd, cmd, sizeof(bp_command_fmt)) < 0) {
- TRACE_STRERROR("[IPC.Write] exception sock:%d", fd);
+ TRACE_ERROR("[IPC.Write] exception sock:%d", fd);
return -1;
}
return 0;
}
str = (char *)calloc((length + 1), sizeof(char));
if (str == NULL) {
- TRACE_STRERROR("[ERROR] calloc length:%d sock:%d", length, fd);
+ TRACE_ERROR("[ERROR] calloc length:%d sock:%d", length, fd);
return NULL;
}
remain_size = length;
free(str);
return NULL;
} else if (recv_size < 0) {
- TRACE_STRERROR("[IPC.Read] exception sock:%d", fd);
+ TRACE_ERROR("[IPC.Read] exception sock:%d", fd);
free(str);
return NULL;
}
}
if (fd < 0 || write(fd, &length, sizeof(unsigned)) <= 0 ||
write(fd, str, length * sizeof(char)) <= 0) {
- TRACE_STRERROR("[IPC.Write] exception sock:%d", fd);
+ TRACE_ERROR("[IPC.Write] exception sock:%d", fd);
return -1;
}
return 0;
return -1;
}
if (fd < 0 || write(fd, value, type_size) <= 0) {
- TRACE_STRERROR("[IPC.Write] exception sock:%d", fd);
+ TRACE_ERROR("[IPC.Write] exception sock:%d", fd);
return -1;
}
return 0;
TRACE_ERROR("[ERROR] closed peer sock:%d", fd);
return -1;
} else if (recv_size < 0) {
- TRACE_STRERROR("[IPC.Read] exception sock:%d", fd);
+ TRACE_ERROR("[IPC.Read] exception sock:%d", fd);
return -1;
}
return 0;
{
bp_error_defs errorcode = basecode;
if (errno == EPIPE) {
- TRACE_STRERROR("[EPIPE:%d] Broken Pipe", errno);
+ TRACE_ERROR("[EPIPE:%d] Broken Pipe", errno);
errorcode = BP_ERROR_IO_ERROR;
} else if (errno == EAGAIN) {
- TRACE_STRERROR("[EAGAIN:%d]", errno);
+ TRACE_ERROR("[EAGAIN:%d]", errno);
errorcode = BP_ERROR_IO_EAGAIN;
} else if (errno == EINTR) {
- TRACE_STRERROR("[EINTR:%d]", errno);
+ TRACE_ERROR("[EINTR:%d]", errno);
errorcode = BP_ERROR_IO_EINTR;
} else {
- TRACE_STRERROR("[errno:%d]", errno);
+ TRACE_ERROR("[errno:%d]", errno);
}
return errorcode;
}
}
#define TRACE_DEBUG(format, ARG...) bp_ftrace("[%s][%s:%d] "format"\n", LOG_TAG, __FUNCTION__, __LINE__, ##ARG)
#define TRACE_ERROR(format, ARG...) bp_ftrace("[%s][%s:%d] "format" [%s]\n", LOG_TAG, __FUNCTION__, __LINE__, ##ARG, strerror(errno))
-#define TRACE_STRERROR(format, ARG...) bp_ftrace("[%s][%s:%d] "format"\n", LOG_TAG, __FUNCTION__, __LINE__, ##ARG)
#define TRACE_INFO(format, ARG...) bp_ftrace("[%s][%s:%d] "format"\n", LOG_TAG, __FUNCTION__, __LINE__, ##ARG)
#define TRACE_WARN(format, ARG...) bp_ftrace("[%s][%s:%d] "format"\n", LOG_TAG, __FUNCTION__, __LINE__, ##ARG)
#define TRACE_SECURE_DEBUG(format, ARG...) bp_ftrace("[%s][%s:%d] "format"\n", LOG_TAG, __FUNCTION__, __LINE__, ##ARG)
#define TRACE_DEBUG(...) do { } while(0)
#endif
#define TRACE_ERROR(format, ARG...) LOGE(format, ##ARG)
-#define TRACE_STRERROR(format, ARG...) LOGE(format" [%s]", ##ARG, strerror(errno))
#define TRACE_INFO(format, ARG...) LOGI(format, ##ARG)
#define TRACE_WARN(format, ARG...) LOGW(format, ##ARG)
#define TRACE_DEBUG(...) do { } while(0)
#define TRACE_ERROR(...) do { } while(0)
-#define TRACE_STRERROR(...) do { } while(0)
#define TRACE_INFO(...) do { } while(0)
#define TRACE_WARN(...) do { } while(0)
#define TRACE_SECURE_DEBUG(...) do { } while(0)
// create thread here ( getting event_socket )
if (pthread_create(&g_adaptor_event_thread_pid, NULL,
__tab_adaptor_event_manager, g_adaptorinfo) != 0) {
- TRACE_STRERROR("[CRITICAL] pthread_create");
+ TRACE_ERROR("[CRITICAL] pthread_create");
return -1;
}
pthread_detach(g_adaptor_event_thread_pid);