Merge "Fixed some svaces for strerror" into tizen submit/tizen/20180327.123653
authorJaehyun Kim <jeik01.kim@samsung.com>
Tue, 27 Mar 2018 07:54:22 +0000 (07:54 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Tue, 27 Mar 2018 07:54:23 +0000 (07:54 +0000)
packaging/net-config.spec
src/utils/network-accessibility.c
src/utils/util.c

index 66b1d4b..f7bd59a 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;
 }