summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2018-08-06 07:55:41 +0900
committerHwanKyu Jhun <h.jhun@samsung.com>2018-08-06 00:03:50 +0000
commit6fa344267fb6b921ddc301d532f00499339e993b (patch)
tree579b99471c78203c84f141eaf31fe6897010b7cf
parent87bc6d1cbc578186c779f31bd9592dd4282c9678 (diff)
downloadaul-1-6fa344267fb6b921ddc301d532f00499339e993b.tar.gz
aul-1-6fa344267fb6b921ddc301d532f00499339e993b.tar.bz2
aul-1-6fa344267fb6b921ddc301d532f00499339e993b.zip
Use thread-safe function
- Uses strerror_r() function Change-Id: I16aeaf313ee0366fdfd8a2c5d7cc8b487cd0032f Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rwxr-xr-xsrc/launch.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/launch.c b/src/launch.c
index 24387feb..ccfc8837 100755
--- a/src/launch.c
+++ b/src/launch.c
@@ -194,6 +194,7 @@ API int app_send_cmd_to_launchpad(const char *pad_type, uid_t uid, int cmd, bund
int fd;
int len;
int res;
+ char buf[1024];
fd = aul_sock_create_launchpad_client(pad_type, uid);
if (fd < 0)
@@ -210,13 +211,19 @@ retry_recv:
len = recv(fd, &res, sizeof(int), 0);
if (len == -1) {
if (errno == EAGAIN) {
- _E("recv timeout: %s", strerror(errno));
+ _E("recv timeout: %d(%s)",
+ errno,
+ strerror_r(errno, buf, sizeof(buf)));
res = -EAGAIN;
} else if (errno == EINTR) {
- _D("recv: %s", strerror(errno));
+ _D("recv: %d(%s)",
+ errno,
+ strerror_r(errno, buf, sizeof(buf)));
goto retry_recv;
} else {
- _E("recv error: %s", strerror(errno));
+ _E("recv error: %d(%s)",
+ errno,
+ strerror_r(errno, buf, sizeof(buf)));
res = -ECOMM;
}
}