summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSung-jae Park <nicesj.park@samsung.com>2014-11-23 11:48:42 +0900
committerSung-jae Park <nicesj.park@samsung.com>2014-11-23 11:48:42 +0900
commit844ab2f037c084e22f7110f22074a4b0ac824c6f (patch)
tree0957a5bd498737705f7d2c1551979acd5805c91b /src
parent8cdcd863bcd0e5ad7160d6902c0f3ef470e0acbe (diff)
downloadcom-core-844ab2f037c084e22f7110f22074a4b0ac824c6f.tar.gz
com-core-844ab2f037c084e22f7110f22074a4b0ac824c6f.tar.bz2
com-core-844ab2f037c084e22f7110f22074a4b0ac824c6f.zip
Add new API for compatibility instead of changing API signature.
[model] Redwood,Kiran,B3(Wearable) [binary_type] AP [customer] Docomo/Orange/ATT/Open [issue#] N/A [problem] [cause] [solution] [team] HomeTF [request] [horizontal_expansion] Change-Id: I721703d1ba4271ffdb07865d151bb868e7cf7464
Diffstat (limited to 'src')
-rw-r--r--src/com-core.c4
-rw-r--r--src/com-core_thread.c4
-rw-r--r--src/secure_socket.c14
3 files changed, 16 insertions, 6 deletions
diff --git a/src/com-core.c b/src/com-core.c
index bf627e6..208b564 100644
--- a/src/com-core.c
+++ b/src/com-core.c
@@ -535,7 +535,7 @@ EAPI int com_core_recv_with_fd(int handle, char *buffer, int size, int *sender_p
return -EINVAL;
}
- ret = secure_socket_recv(handle, buffer + readsize, size, sender_pid, recv_fd);
+ ret = secure_socket_recv_with_fd(handle, buffer + readsize, size, sender_pid, recv_fd);
if (ret < 0) {
if (ret == -EAGAIN) {
DbgPrint("Retry to get data (%d:%d)\n", readsize, size);
@@ -606,7 +606,7 @@ EAPI int com_core_send_with_fd(int handle, const char *buffer, int size, double
return -EINVAL;
}
- ret = secure_socket_send(handle, buffer + writesize, size, fd);
+ ret = secure_socket_send_with_fd(handle, buffer + writesize, size, fd);
if (ret < 0) {
if (ret == -EAGAIN) {
DbgPrint("Retry to send data (%d:%d)\n", writesize, size);
diff --git a/src/com-core_thread.c b/src/com-core_thread.c
index 4e186b5..38c5a12 100644
--- a/src/com-core_thread.c
+++ b/src/com-core_thread.c
@@ -404,7 +404,7 @@ static void *client_cb(void *data)
break;
}
- ret = secure_socket_recv(tcb->handle, chunk->data, chunk->size, &chunk->pid, &chunk->fd);
+ ret = secure_socket_recv_with_fd(tcb->handle, chunk->data, chunk->size, &chunk->pid, &chunk->fd);
if (ret <= 0) {
destroy_chunk(chunk);
if (ret == -EAGAIN) {
@@ -904,7 +904,7 @@ EAPI int com_core_thread_send_with_fd(int handle, const char *buffer, int size,
return -EINVAL;
}
- ret = secure_socket_send(tcb->handle, buffer + writesize, size, fd);
+ ret = secure_socket_send_with_fd(tcb->handle, buffer + writesize, size, fd);
if (ret < 0) {
if (ret == -EAGAIN) {
DbgPrint("Retry to send data (%d:%d)\n", writesize, size);
diff --git a/src/secure_socket.c b/src/secure_socket.c
index a1f69eb..a299b50 100644
--- a/src/secure_socket.c
+++ b/src/secure_socket.c
@@ -418,7 +418,7 @@ EAPI int secure_socket_get_connection_handle(int server_handle)
return handle;
}
-EAPI int secure_socket_send(int handle, const char *buffer, int size, int fd)
+EAPI int secure_socket_send_with_fd(int handle, const char *buffer, int size, int fd)
{
struct msghdr msg;
struct iovec iov;
@@ -470,7 +470,12 @@ EAPI int secure_socket_send(int handle, const char *buffer, int size, int fd)
return iov.iov_len;
}
-EAPI int secure_socket_recv(int handle, char *buffer, int size, int *sender_pid, int *fd)
+EAPI int secure_socket_send(int handle, const char *buffer, int size)
+{
+ return secure_socket_send_with_fd(handle, buffer, size, -1);
+}
+
+EAPI int secure_socket_recv_with_fd(int handle, char *buffer, int size, int *sender_pid, int *fd)
{
struct msghdr msg;
struct cmsghdr *cmsg;
@@ -533,6 +538,11 @@ EAPI int secure_socket_recv(int handle, char *buffer, int size, int *sender_pid,
return iov.iov_len;
}
+EAPI int secure_socket_recv(int handle, char *buffer, int size, int *sender_pid)
+{
+ return secure_socket_recv_with_fd(handle, buffer, size, sender_pid, NULL);
+}
+
EAPI int secure_socket_destroy_handle(int handle)
{
if (close(handle) < 0) {