Convert error value 12/229712/1
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 3 Apr 2020 03:59:10 +0000 (12:59 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Fri, 3 Apr 2020 03:59:10 +0000 (12:59 +0900)
Before returning the functions, the error value has to be converted by
AUL error values.

Change-Id: If7c430e6212909509bb564607be7e74db7b80f2c
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/aul_rpc_port.c

index 2fe6279..fa22ee1 100644 (file)
 #include <unistd.h>
 #include <bundle_internal.h>
 
+#include "aul.h"
 #include "aul_api.h"
-#include "aul_util.h"
-#include "aul_sock.h"
+#include "aul_error.h"
 #include "aul_rpc_port.h"
-#include "aul.h"
+#include "aul_sock.h"
+#include "aul_util.h"
 
 static bundle *__create_bundle(const char *appid, const char *port_name)
 {
@@ -74,7 +75,7 @@ API int aul_rpc_port_prepare_stub(const char *appid, const char *port_name)
                _E("Failed to send request(%d:%s)",
                                RPC_PORT_PREPARE_STUB, appid);
                bundle_free(b);
-               return r;
+               return aul_error_convert(r);
        }
        bundle_free(b);
 
@@ -102,14 +103,14 @@ API int aul_rpc_port_create_socket_pair(const char *appid,
        if (fd <= 0 || fd > sysconf(_SC_OPEN_MAX)) {
                _E("Failed to send socket pair creation request. err = %d", fd);
                bundle_free(b);
-               return fd;
+               return aul_error_convert(fd);
        }
        bundle_free(b);
 
        r = aul_sock_recv_reply_sock_fd(fd, fds, 2);
        if (r != 0) {
                _E("Failed to receive socket fds. err = %d", r);
-               return r;
+               return aul_error_convert(r);
        }
 
        return AUL_R_OK;
@@ -140,7 +141,7 @@ API int aul_rpc_port_notify_rpc_finished(void)
        if (r != 0) {
                _E("Failed to notify rpc finished(%d). err = %d", getpid(), r);
                bundle_free(b);
-               return r;
+               return aul_error_convert(r);
        }
        bundle_free(b);