diff options
author | Sung-jae Park <nicesj.park@samsung.com> | 2014-07-01 13:30:15 +0900 |
---|---|---|
committer | Sung-jae Park <nicesj.park@samsung.com> | 2014-07-01 13:30:15 +0900 |
commit | 12d5f709df6e1aebeba1fc692194007740784802 (patch) | |
tree | 407543e235b2be7fd6767371904e8d31f7bc0321 | |
parent | 960f0342ab2ade392af7a7d6234344e27fa76fd1 (diff) | |
download | com-core-12d5f709df6e1aebeba1fc692194007740784802.tar.gz com-core-12d5f709df6e1aebeba1fc692194007740784802.tar.bz2 com-core-12d5f709df6e1aebeba1fc692194007740784802.zip |
Update return vale - for exceptional case
Change-Id: I58823aa462ac6728773095448214fac58652214a
-rw-r--r-- | packaging/libcom-core.spec | 2 | ||||
-rw-r--r-- | src/com-core_thread.c | 3 | ||||
-rw-r--r-- | src/secure_socket.c | 9 |
3 files changed, 9 insertions, 5 deletions
diff --git a/packaging/libcom-core.spec b/packaging/libcom-core.spec index e56cc20..53cdc35 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.5.10 +Version: 0.5.11 Release: 1 Group: Base/IPC License: Apache-2.0 diff --git a/src/com-core_thread.c b/src/com-core_thread.c index 2a8fc5a..f5fc9c6 100644 --- a/src/com-core_thread.c +++ b/src/com-core_thread.c @@ -669,8 +669,9 @@ EAPI int com_core_thread_client_create(const char *addr, int is_sync, int (*serv int ret; client_fd = secure_socket_create_client(addr); - if (client_fd < 0) + if (client_fd < 0) { return client_fd; + } if (fcntl(client_fd, F_SETFD, FD_CLOEXEC) < 0) { ErrPrint("Error: %s\n", strerror(errno)); diff --git a/src/secure_socket.c b/src/secure_socket.c index 58cc898..c6252df 100644 --- a/src/secure_socket.c +++ b/src/secure_socket.c @@ -77,8 +77,8 @@ static inline int create_unix_socket(const char *peer, int port, struct sockaddr handle = socket(PF_UNIX, SOCK_STREAM, 0); if (handle < 0) { + handle = -errno; ErrPrint("Failed to create a socket %s\n", strerror(errno)); - return -1; } return handle; @@ -316,7 +316,7 @@ EAPI int secure_socket_create_server(const char *peer) addr = parse_scheme(peer, &port, &vtable); if (!addr) { ErrPrint("Failed to parse scheme\n"); - return -EFAULT; + return -EINVAL; } switch (vtable.type) { @@ -511,9 +511,12 @@ EAPI int secure_socket_recv(int handle, char *buffer, int size, int *sender_pid) EAPI int secure_socket_destroy_handle(int handle) { if (close(handle) < 0) { + int ret; + ret = -errno; ErrPrint("close: %s\n", strerror(errno)); - return -1; + return ret; } + return 0; } |