summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSung-jae Park <nicesj.park@samsung.com>2013-06-27 14:06:13 +0900
committerSung-jae Park <nicesj.park@samsung.com>2013-06-27 14:06:13 +0900
commit7a4800c7368d0749a0ee72cda345afa48be49c0a (patch)
treea882d344768705d4544907c1b3d07b6081fadd4d
parent04e988f25ee3ab65e7c63c5eb6875ef174bb5b82 (diff)
downloadcom-core-7a4800c7368d0749a0ee72cda345afa48be49c0a.tar.gz
com-core-7a4800c7368d0749a0ee72cda345afa48be49c0a.tar.bz2
com-core-7a4800c7368d0749a0ee72cda345afa48be49c0a.zip
Update Log Tag
Change-Id: Ic830d5000575d9cd14012589e040ecf2248d70d8
-rw-r--r--include/debug.h4
-rw-r--r--packaging/libcom-core.spec2
-rw-r--r--src/com-core.c8
-rw-r--r--src/com-core_packet.c5
-rw-r--r--src/com-core_thread.c10
5 files changed, 9 insertions, 20 deletions
diff --git a/include/debug.h b/include/debug.h
index d629ed5..dcb8d03 100644
--- a/include/debug.h
+++ b/include/debug.h
@@ -28,8 +28,8 @@
#endif
#if !defined(FLOG)
-#define DbgPrint(format, arg...) SECURE_LOGD("[%s/%s:%d] " format, util_basename(__FILE__), __func__, __LINE__, ##arg)
-#define ErrPrint(format, arg...) SECURE_LOGE("[%s/%s:%d] " format, util_basename(__FILE__), __func__, __LINE__, ##arg)
+#define DbgPrint(format, arg...) SECURE_LOGD(format, ##arg)
+#define ErrPrint(format, arg...) SECURE_LOGE(format, ##arg)
#else
extern FILE *__file_log_fp;
#define DbgPrint(format, arg...) do { fprintf(__file_log_fp, "[LOG] [%s/%s:%d] " format, util_basename(__FILE__), __func__, __LINE__, ##arg); fflush(__file_log_fp); } while (0)
diff --git a/packaging/libcom-core.spec b/packaging/libcom-core.spec
index 9507b1d..619e495 100644
--- a/packaging/libcom-core.spec
+++ b/packaging/libcom-core.spec
@@ -1,6 +1,6 @@
Name: libcom-core
Summary: Library for the light-weight IPC
-Version: 0.4.1
+Version: 0.4.2
Release: 1
Group: HomeTF/Framework
License: Apache License
diff --git a/src/com-core.c b/src/com-core.c
index 7aa172e..1fb3c48 100644
--- a/src/com-core.c
+++ b/src/com-core.c
@@ -134,19 +134,18 @@ static gboolean accept_cb(GIOChannel *src, GIOCondition cond, gpointer cbdata)
}
if ((cond & G_IO_ERR) || (cond & G_IO_HUP) || (cond & G_IO_NVAL)) {
- DbgPrint("Client connection is lost\n");
+ ErrPrint("Client connection is lost\n");
secure_socket_destroy_handle(socket_fd);
free(cbdata);
return FALSE;
}
- DbgPrint("New connectino arrived: socket(%d)\n", socket_fd);
client_fd = secure_socket_get_connection_handle(socket_fd);
if (client_fd < 0) {
free(cbdata);
return FALSE;
}
- DbgPrint("New client: %d\n", client_fd);
+ DbgPrint("New connectino arrived: server(%d), client(%d)\n", socket_fd, client_fd);
if (fcntl(client_fd, F_SETFD, FD_CLOEXEC) < 0)
ErrPrint("Error: %s\n", strerror(errno));
@@ -182,7 +181,6 @@ static gboolean accept_cb(GIOChannel *src, GIOCondition cond, gpointer cbdata)
g_io_channel_unref(gio);
invoke_con_cb_list(client_fd);
- DbgPrint("New client is connected with %d\n", client_fd);
return TRUE;
}
@@ -214,7 +212,7 @@ EAPI int com_core_server_create(const char *addr, int is_sync, int (*service_cb)
if (!is_sync && fcntl(fd, F_SETFL, O_NONBLOCK) < 0)
ErrPrint("fcntl: %s\n", strerror(errno));
- DbgPrint("Create new IO channel for socket FD: %d\n", fd);
+ DbgPrint("Create new IO channel for server FD: %d\n", fd);
gio = g_io_channel_unix_new(fd);
if (!gio) {
ErrPrint("Failed to create new io channel\n");
diff --git a/src/com-core_packet.c b/src/com-core_packet.c
index d6189df..4869cc9 100644
--- a/src/com-core_packet.c
+++ b/src/com-core_packet.c
@@ -471,8 +471,6 @@ EAPI struct packet *com_core_packet_oneshot_send(const char *addr, struct packet
if (fd < 0)
return NULL;
- DbgPrint("FD: %d\n", fd);
-
if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0)
ErrPrint("fcntl: %s\n", strerror(errno));
@@ -483,8 +481,6 @@ EAPI struct packet *com_core_packet_oneshot_send(const char *addr, struct packet
if (ret < 0)
goto out;
- DbgPrint("Sent: %d bytes (%d bytes)\n", ret, packet_size(packet));
-
ptr = malloc(packet_header_size());
if (!ptr) {
ErrPrint("Heap: %s\n", strerror(errno));
@@ -509,7 +505,6 @@ EAPI struct packet *com_core_packet_oneshot_send(const char *addr, struct packet
}
size = packet_payload_size(result);
- DbgPrint("Payload size: %d\n", size);
if (size < 0) {
packet_destroy(result);
result = NULL;
diff --git a/src/com-core_thread.c b/src/com-core_thread.c
index 4f0b12b..7b5655e 100644
--- a/src/com-core_thread.c
+++ b/src/com-core_thread.c
@@ -437,12 +437,12 @@ static gboolean evt_pipe_cb(GIOChannel *src, GIOCondition cond, gpointer data)
}
if (!(cond & G_IO_IN)) {
- DbgPrint("PIPE is not valid\n");
+ ErrPrint("PIPE is not valid\n");
goto errout;
}
if ((cond & G_IO_ERR) || (cond & G_IO_HUP) || (cond & G_IO_NVAL)) {
- DbgPrint("PIPE is not valid\n");
+ ErrPrint("PIPE is not valid\n");
goto errout;
}
@@ -512,7 +512,7 @@ static inline struct tcb *tcb_create(int client_fd, int is_sync, int (*service_c
return NULL;
}
- DbgPrint("[%d] New TCB created: %d, %d\n", client_fd, tcb->evt_pipe[PIPE_READ], tcb->evt_pipe[PIPE_WRITE]);
+ DbgPrint("[%d] New TCB created: R(%d), W(%d)\n", client_fd, tcb->evt_pipe[PIPE_READ], tcb->evt_pipe[PIPE_WRITE]);
return tcb;
}
@@ -542,7 +542,6 @@ static gboolean accept_cb(GIOChannel *src, GIOCondition cond, gpointer data)
return FALSE;
}
- DbgPrint("New connection is made: socket(%d)\n", socket_fd);
fd = secure_socket_get_connection_handle(socket_fd);
if (fd < 0) {
ErrPrint("Failed to get client fd from socket\n");
@@ -550,7 +549,6 @@ static gboolean accept_cb(GIOChannel *src, GIOCondition cond, gpointer data)
return FALSE;
}
- DbgPrint("New client: %d\n", fd);
if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0)
ErrPrint("Error: %s\n", strerror(errno));
@@ -596,7 +594,6 @@ static gboolean accept_cb(GIOChannel *src, GIOCondition cond, gpointer data)
}
g_io_channel_unref(gio);
- DbgPrint("New client is connected with %d\n", tcb->handle);
invoke_con_cb_list(tcb->handle);
ret = pthread_create(&tcb->thid, NULL, client_cb, tcb);
@@ -671,7 +668,6 @@ EAPI int com_core_thread_client_create(const char *addr, int is_sync, int (*serv
g_io_channel_unref(gio);
- DbgPrint("New client is connected with %d\n", client_fd);
invoke_con_cb_list(tcb->handle);
ret = pthread_create(&tcb->thid, NULL, client_cb, tcb);