Use strerror_r instead of strerror 14/87614/4 accepted/tizen/3.0/ivi/20161011.070356 accepted/tizen/3.0/mobile/20161015.034441 accepted/tizen/3.0/tv/20161016.010114 accepted/tizen/3.0/wearable/20161015.084420 accepted/tizen/common/20160912.181256 accepted/tizen/ivi/20160912.215441 accepted/tizen/mobile/20160912.215349 accepted/tizen/tv/20160912.215405 accepted/tizen/wearable/20160912.215423 submit/tizen/20160912.051209 submit/tizen_3.0_ivi/20161010.000008 submit/tizen_3.0_mobile/20161015.000007 submit/tizen_3.0_tv/20161015.000006 submit/tizen_3.0_wearable/20161015.000006
authorHyunho Kang <hhstark.kang@samsung.com>
Fri, 9 Sep 2016 01:09:41 +0000 (10:09 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Fri, 9 Sep 2016 05:40:26 +0000 (22:40 -0700)
Change-Id: I9f38c67beca3be899d2ed8fd532cf28460e68e58
Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
widget_toolkit/src/compositor.c
widget_viewer_evas/src/widget_viewer_evas.c
widget_viewer_sdk/src/main.c

index e21bb26..d5f89e0 100644 (file)
@@ -37,6 +37,7 @@
 #define LOG_TAG "WIDGET_TOOLKIT"
 
 #define API __attribute__((visibility("default")))
+#define ERR_BUFFER_SIZE                1024
 
 struct compositor_handler {
        char *app_id;
@@ -153,16 +154,18 @@ static void __handler_free(gpointer val)
 static void __set_runtime_dir(void)
 {
        char buf[256];
+       char err_buf[ERR_BUFFER_SIZE];
 
        snprintf(buf, sizeof(buf) - 1, "/run/user/%d", getuid());
        if (setenv("XDG_RUNTIME_DIR", buf, 0) < 0)
-               _E("Unable to set XDB_RUNTIME_DIR: %s (%s)\n", buf, strerror(errno));
+               _E("Unable to set XDB_RUNTIME_DIR: %s (%s)\n", buf, strerror_r(errno, err_buf, sizeof(err_buf)));
 }
 
 API const char *_compositor_init(Evas_Object *win)
 {
        static const char *compositor_name = NULL;
        char app_id[255];
+       char err_buf[ERR_BUFFER_SIZE];
 
        if (__compositor_name)
                return __compositor_name;
@@ -184,7 +187,7 @@ API const char *_compositor_init(Evas_Object *win)
        }
 
        if (setenv("WAYLAND_DISPLAY", compositor_name, 1) < 0)
-               _E("failed to set WAYLAND_DISPLAY: %s\n", strerror(errno));
+               _E("failed to set WAYLAND_DISPLAY: %s\n", strerror_r(errno, err_buf, sizeof(err_buf)));
 
        evas_object_smart_callback_add(win, PEPPER_EFL_OBJ_ADD, __obj_added_cb, NULL);
        evas_object_smart_callback_add(win, PEPPER_EFL_OBJ_DEL, __obj_deleted_cb, NULL);
index 7ac71bd..f27891e 100644 (file)
 #define DEFAULT_CATEGORY "default"
 
 #define WIDGET_INFO_TAG "__WIDGET_INFO__"
+#define ERR_BUFFER_SIZE                1024
 
 /*!
  * \note
@@ -756,13 +757,14 @@ static void _clicked_cb(void *data, Evas_Object *obj, const char *emission, cons
        widget_viewer_evas_activate_faulted_widget(info->layout);
 }
 
-static inline struct widget_info *create_info(Evas_Object *parent, const char *widget_id, const char *instance_id, const char *content_info)
+static struct widget_info *create_info(Evas_Object *parent, const char *widget_id, const char *instance_id, const char *content_info)
 {
        struct widget_info *info;
+       char err_buf[ERR_BUFFER_SIZE];
 
        info = (struct widget_info *)calloc(1, sizeof(*info));
        if (!info) {
-               ErrPrint("malloc: %s", strerror(errno));
+               ErrPrint("malloc: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
                goto out;
        }
 
index 8a28cf0..53249d0 100644 (file)
@@ -41,6 +41,7 @@ int errno;
 #include "main.h"
 #include "debug.h"
 
+#define ERR_BUFFER_SIZE                1024
 #define WATCH_CATEGORY "http://tizen.org/category/wearable_clock"
 #define DEFAULT_WATCH "org.tizen.digitalclock"
 #define LAZY_WATCH_TIME 3.0f
@@ -731,6 +732,7 @@ static void _app_control(app_control_h service, void *data)
 
 int main(int argc, char *argv[])
 {
+       char err_buf[ERR_BUFFER_SIZE];
        ui_app_lifecycle_callback_s event_callback;
 
        event_callback.create = app_create;
@@ -740,10 +742,10 @@ int main(int argc, char *argv[])
        event_callback.app_control = _app_control;
 
        if (setenv("BUFMGR_LOCK_TYPE", "once", 0) < 0)
-               LOGE("setenv(BUFMGR_LOCK_TYPE) is failed: %s", strerror(errno));
+               LOGE("setenv(BUFMGR_LOCK_TYPE) is failed: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
 
        if (setenv("BUFMGR_MAP_CACHE", "true", 0) < 0)
-               LOGE("setenv(BUFMGR_MAP_CACHE) is failed: %s", strerror(errno));
+               LOGE("setenv(BUFMGR_MAP_CACHE) is failed: %s", strerror_r(errno, err_buf, sizeof(err_buf)));
 
        return ui_app_main(argc, argv, &event_callback, NULL);
 }