Fixed some svaces for strerror 69/173769/1
authorhyunuktak <hyunuk.tak@samsung.com>
Mon, 26 Mar 2018 01:24:11 +0000 (10:24 +0900)
committerhyunuktak <hyunuk.tak@samsung.com>
Mon, 26 Mar 2018 01:24:14 +0000 (10:24 +0900)
Change-Id: I3c7e629f375867d1a25654f2e2a2d4f7cf58ce81
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
packaging/net-config.spec
src/utils/network-accessibility.c
src/utils/util.c

index a8aa2d3..008181d 100755 (executable)
@@ -1,6 +1,6 @@
 Name:          net-config
 Summary:       TIZEN Network Configuration service
-Version:       1.1.127
+Version:       1.1.128
 Release:       3
 Group:         System/Network
 License:       Apache-2.0
index df1312c..9d698db 100755 (executable)
@@ -231,6 +231,7 @@ static gboolean __received_data_event(GIOChannel *channel,
 {
        int n, fd;
        unsigned char buf[BUF_SIZE] = { 0, };
+       char error_buf[MAX_SIZE_ERROR_BUFFER] = {0, };
 
        if (net_params == NULL)
                return FALSE;
@@ -247,7 +248,8 @@ static gboolean __received_data_event(GIOChannel *channel,
        buf[BUF_SIZE - 1] = '\0';
 
        if (n < 0) {
-               ERR("read failed. %s", strerror(errno));
+               ERR("read failed. %s",
+                       strerror_r(errno, error_buf, MAX_SIZE_ERROR_BUFFER));
 
                goto cleanup;
        } else if (n == 0) {
@@ -273,6 +275,7 @@ static gboolean __send_data_event(GIOChannel *channel,
                GIOCondition condition, gpointer data)
 {
        int n, fd;
+       char error_buf[MAX_SIZE_ERROR_BUFFER] = {0, };
        const char *request_data =
                        "GET /index.html HTTP/1.1\r\nHost: connman.net\r\n\r\n";
 
@@ -295,7 +298,8 @@ static gboolean __send_data_event(GIOChannel *channel,
        DBG("Sent %d bytes", n);
 
        if (n < 0) {
-               ERR("send failed. %s", strerror(errno));
+               ERR("send failed. %s",
+                       strerror_r(errno, error_buf, MAX_SIZE_ERROR_BUFFER));
 
                goto cleanup;
        } else if (n == 0) {
index 3c1c60a..b45cea2 100755 (executable)
@@ -582,6 +582,7 @@ int netconfig_execute_file_no_wait(const char *file_path, char *const args[])
 
        struct sigaction act;
        int state = 0;
+       char error_buf[MAX_SIZE_ERROR_BUFFER] = {0, };
 
        act.sa_handler = no_wait_signal_handler;
        sigemptyset(&act.sa_mask);
@@ -604,7 +605,8 @@ int netconfig_execute_file_no_wait(const char *file_path, char *const args[])
 
                errno = 0;
                if (execvp(file_path, args) == -1) {
-                       ERR("Fail to execute command (%s)", strerror(errno));
+                       ERR("Fail to execute command (%s)",
+                               strerror_r(errno, error_buf, MAX_SIZE_ERROR_BUFFER));
                        return -1;
                }
        } else if (pid > 0) {
@@ -612,7 +614,8 @@ int netconfig_execute_file_no_wait(const char *file_path, char *const args[])
                return rv;
        }
 
-       DBG("failed to fork(%s)", strerror(errno));
+       DBG("failed to fork(%s)",
+               strerror_r(errno, error_buf, MAX_SIZE_ERROR_BUFFER));
        return -EIO;
 }