Replace strerror with errno
authorSung-jae Park <nicesj.park@samsung.com>
Mon, 20 Apr 2015 08:01:45 +0000 (17:01 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Mon, 20 Apr 2015 08:01:45 +0000 (17:01 +0900)
strerror is not threadsafe, so the prevent warns.

[model] Redwood,Kiran,B3(Wearable)
[binary_type] AP
[customer] Docomo/Orange/ATT/Open
[issue#] N/A
[problem]
[cause]
[solution]
[team] HomeTF
[request]
[horizontal_expansion]

Change-Id: Ibd1bbe6cb9b746c4df7c9e951d83e8d93323bef6

32 files changed:
include/debug.h
include/util.h
pkgmgr_widget/common/src/common.c
src/buffer_handler.c
src/buffer_handler_wayland.c
src/client_life.c
src/client_rpc.c
src/critical_log.c
src/event.c
src/fault_manager.c
src/file_service.c
src/group.c
src/instance.c
src/io.c
src/main.c
src/package.c
src/parser.c
src/pkgmgr.c
src/script_handler.c
src/server.c
src/service_common.c
src/setting.c
src/shortcut_service.c
src/slave_life.c
src/slave_rpc.c
src/util.c
src/utility_service.c
src/widget-mgr.c
src/xmonitor.c
src/xmonitor_wayland.c
widget-mgr/src/node.c
widget-mgr/src/widget-mgr.c

index ac1a079..cbf1ea0 100644 (file)
@@ -50,13 +50,13 @@ extern FILE *__file_log_fp;
 
 #define PERF_BEGIN() do { \
        if (gettimeofday(&__stv, NULL) < 0) { \
-               ErrPrint("gettimeofday: %s\n", strerror(errno)); \
+               ErrPrint("gettimeofday: %d\n", errno); \
        } \
 } while (0)
 
 #define PERF_MARK(tag) do { \
        if (gettimeofday(&__etv, NULL) < 0) { \
-               ErrPrint("gettimeofday: %s\n", strerror(errno)); \
+               ErrPrint("gettimeofday: %d\n", errno); \
        } \
        timersub(&__etv, &__stv, &__rtv); \
        DbgPrint("[%s] %u.%06u\n", tag, __rtv.tv_sec, __rtv.tv_usec); \
index dabee4b..132bfda 100644 (file)
@@ -45,7 +45,7 @@ do { \
        int ret; \
        ret = pthread_mutex_lock(handle); \
        if (ret != 0) \
-               ErrPrint("Failed to lock: %s\n", strerror(ret)); \
+               ErrPrint("pthread_mutex_lock: %d\n", ret); \
 } while (0)
 
 #define CRITICAL_SECTION_END(handle) \
@@ -53,31 +53,31 @@ do { \
        int ret; \
        ret = pthread_mutex_unlock(handle); \
        if (ret != 0) \
-               ErrPrint("Failed to unlock: %s\n", strerror(ret)); \
+               ErrPrint("pthread_mutex_unlock: %d\n", ret); \
 } while (0)
 
 #define CANCEL_SECTION_BEGIN() do { \
        int ret; \
        ret = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); \
        if (ret != 0) \
-               ErrPrint("Unable to set cancelate state: %s\n", strerror(ret)); \
+               ErrPrint("Unable to set cancelate state: %d\n", ret); \
 } while (0)
 
 #define CANCEL_SECTION_END() do { \
        int ret; \
        ret = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); \
        if (ret != 0) \
-               ErrPrint("Unable to set cancelate state: %s\n", strerror(ret)); \
+               ErrPrint("Unable to set cancelate state: %d\n", ret); \
 } while (0)
 
 #define CLOSE_PIPE(p)  do { \
        int status; \
        status = close(p[PIPE_READ]); \
        if (status < 0) \
-               ErrPrint("close: %s\n", strerror(errno)); \
+               ErrPrint("close: %d\n", errno); \
        status = close(p[PIPE_WRITE]); \
        if (status < 0) \
-               ErrPrint("close: %s\n", strerror(errno)); \
+               ErrPrint("close: %d\n", errno); \
 } while (0)
 
 #define PIPE_READ 0
index f622a5e..2667446 100644 (file)
@@ -1909,7 +1909,7 @@ int db_init(void)
        }
 
        if (lstat(s_info.dbfile, &stat) < 0) {
-               ErrPrint("%s\n", strerror(errno));
+               ErrPrint("%d\n", errno);
                db_util_close(s_info.handle);
                s_info.handle = NULL;
                return -EIO;
@@ -2068,7 +2068,7 @@ static void update_i18n_name(struct widget *widget, xmlNodePtr node)
 
        i18n = calloc(1, sizeof(*i18n));
        if (!i18n) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                xmlFree(name);
                xmlFree(lang);
                return;
@@ -2114,7 +2114,7 @@ static void update_i18n_icon(struct widget *widget, xmlNodePtr node)
                        i18n->icon = icon;
                        icon = abspath_strdup(i18n->icon);
                        if (!icon) {
-                               ErrPrint("Heap: %s\n", strerror(errno));
+                               ErrPrint("strdup: %d\n", errno);
                        } else {
                                abspath((char *)i18n->icon, (char *)icon);
                                xmlFree(i18n->icon);
@@ -2126,7 +2126,7 @@ static void update_i18n_icon(struct widget *widget, xmlNodePtr node)
 
        i18n = calloc(1, sizeof(*i18n));
        if (!i18n) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                xmlFree(icon);
                xmlFree(lang);
                return;
@@ -2135,7 +2135,7 @@ static void update_i18n_icon(struct widget *widget, xmlNodePtr node)
        i18n->icon = icon;
        icon = abspath_strdup(i18n->icon);
        if (!icon) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
        } else {
                abspath((char *)i18n->icon, (char *)icon);
                xmlFree(i18n->icon);
@@ -2264,7 +2264,7 @@ static void update_size_info(struct widget *widget, int idx, xmlNodePtr node)
 
                tmp_preview = abspath_strdup(widget->preview[idx]);
                if (!tmp_preview) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("strdup: %d\n", errno);
                } else {
                        abspath((char *)widget->preview[idx], (char *)tmp_preview);
                        xmlFree(widget->preview[idx]);
@@ -2494,7 +2494,7 @@ static void update_box(struct widget *widget, xmlNodePtr node)
                        widget->widget_src = src;
                        src = abspath_strdup(widget->widget_src);
                        if (!src) {
-                               ErrPrint("Heap: %s\n", strerror(errno));
+                               ErrPrint("strdup: %d\n", errno);
                        } else {
                                abspath((char *)widget->widget_src, (char *)src);
                                xmlFree(widget->widget_src);
@@ -2571,14 +2571,14 @@ static void update_group(struct widget *widget, xmlNodePtr node)
 
                        group = calloc(1, sizeof(*group));
                        if (!group) {
-                               ErrPrint("Heap: %s\n", strerror(errno));
+                               ErrPrint("calloc: %d\n", errno);
                                xmlFree(category_name);
                                continue;
                        }
 
                        group->cluster = xmlStrdup(cluster_name);
                        if (!group->cluster) {
-                               ErrPrint("Heap: %s\n", strerror(errno));
+                               ErrPrint("xmlStrdup: %d\n", errno);
                                xmlFree(category_name);
                                free(group);
                                continue;
@@ -2632,7 +2632,7 @@ static void update_group(struct widget *widget, xmlNodePtr node)
 
                                option = calloc(1, sizeof(*option));
                                if (!option) {
-                                       ErrPrint("Heap: %s\n", strerror(errno));
+                                       ErrPrint("calloc: %d\n", errno);
                                        xmlFree(key);
                                        xmlFree(value);
                                        continue;
@@ -2712,7 +2712,7 @@ static void update_glance_bar(struct widget *widget, xmlNodePtr node)
                        widget->gbar_src = src;
                        src = abspath_strdup(widget->gbar_src);
                        if (!src) {
-                               ErrPrint("Heap: %s\n", strerror(errno));
+                               ErrPrint("strdup: %d\n", errno);
                        } else {
                                abspath((char *)widget->gbar_src, (char *)src);
                                xmlFree(widget->gbar_src);
@@ -2938,7 +2938,7 @@ int db_install_widget(xmlNodePtr node, const char *appid)
 
        widget = calloc(1, sizeof(*widget));
        if (!widget) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                xmlFree(pkgid);
                return -ENOMEM;
        }
@@ -3027,7 +3027,7 @@ int db_install_widget(xmlNodePtr node, const char *appid)
        } else {
                widget->abi = xmlStrdup((const xmlChar *)"c");
                if (!widget->abi) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("xmlstrdup: %d\n", errno);
                        widget_destroy(widget);
                        return -ENOMEM;
                }
@@ -3045,7 +3045,7 @@ int db_install_widget(xmlNodePtr node, const char *appid)
 
                tmp_libexec = abspath_strdup(widget->libexec);
                if (!tmp_libexec) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("strdup: %d\n", errno);
                        widget_destroy(widget);
                        return -EFAULT;
                }
@@ -3161,7 +3161,7 @@ int db_install_watchapp(xmlNodePtr node, const char *appid)
 
        widget = calloc(1, sizeof(*widget));
        if (!widget) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                xmlFree(pkgid);
                return -ENOMEM;
        }
index 7c43057..eadb4af 100644 (file)
@@ -126,7 +126,7 @@ static inline widget_fb_t create_pixmap(struct buffer_info *info)
 
        buffer = calloc(1, sizeof(*buffer) + sizeof(*gem));
        if (!buffer) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                return NULL;
        }
 
@@ -188,7 +188,7 @@ static inline int create_gem(widget_fb_t buffer)
        if (s_info.fd < 0) {
                gem->data = calloc(1, gem->w * gem->h * gem->depth);
                if (!gem->data) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("calloc: %d\n", errno);
                        return WIDGET_ERROR_OUT_OF_MEMORY;
                }
 
@@ -401,7 +401,7 @@ static inline int load_file_buffer(struct buffer_info *info)
        len = strlen(WIDGET_CONF_IMAGE_PATH) + 40;
        new_id = malloc(len);
        if (!new_id) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -452,16 +452,16 @@ static inline int load_shm_buffer(struct buffer_info *info)
 
        id = shmget(IPC_PRIVATE, size + sizeof(*buffer), IPC_CREAT | 0666);
        if (id < 0) {
-               ErrPrint("shmget: %s\n", strerror(errno));
+               ErrPrint("shmget: %d\n", errno);
                return WIDGET_ERROR_FAULT;
        }
 
        buffer = shmat(id, NULL, 0);
        if (buffer == (void *)-1) {
-               ErrPrint("%s shmat: %s\n", info->id, strerror(errno));
+               ErrPrint("%s shmat: %d\n", info->id, errno);
 
                if (shmctl(id, IPC_RMID, 0) < 0) {
-                       ErrPrint("%s shmctl: %s\n", info->id, strerror(errno));
+                       ErrPrint("%s shmctl: %d\n", info->id, errno);
                }
 
                return WIDGET_ERROR_FAULT;
@@ -476,13 +476,13 @@ static inline int load_shm_buffer(struct buffer_info *info)
 
        new_id = malloc(len);
        if (!new_id) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                if (shmdt(buffer) < 0) {
-                       ErrPrint("shmdt: %s\n", strerror(errno));
+                       ErrPrint("shmdt: %d\n", errno);
                }
 
                if (shmctl(id, IPC_RMID, 0) < 0) {
-                       ErrPrint("shmctl: %s\n", strerror(errno));
+                       ErrPrint("shmctl: %d\n", errno);
                }
 
                return WIDGET_ERROR_OUT_OF_MEMORY;
@@ -526,7 +526,7 @@ static inline int load_pixmap_buffer(struct buffer_info *info)
        len = strlen(SCHEMA_PIXMAP) + 30; /* strlen("pixmap://") + 30 */
        new_id = malloc(len);
        if (!new_id) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                info->is_loaded = 0;
                buffer_handler_pixmap_unref(buffer);
                return WIDGET_ERROR_OUT_OF_MEMORY;
@@ -593,7 +593,7 @@ static inline int unload_file_buffer(struct buffer_info *info)
 
        new_id = strdup(SCHEMA_FILE "/tmp/.live.undefined");
        if (!new_id) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -602,7 +602,7 @@ static inline int unload_file_buffer(struct buffer_info *info)
 
        path = widget_util_uri_to_path(info->id);
        if (path && unlink(path) < 0) {
-               ErrPrint("unlink: %s\n", strerror(errno));
+               ErrPrint("unlink: %d\n", errno);
        }
 
        DbgFree(info->id);
@@ -617,7 +617,7 @@ static inline int unload_shm_buffer(struct buffer_info *info)
 
        new_id = strdup(SCHEMA_SHM "-1");
        if (!new_id) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -634,11 +634,11 @@ static inline int unload_shm_buffer(struct buffer_info *info)
        }
 
        if (shmdt(info->buffer) < 0) {
-               ErrPrint("Detach shm: %s\n", strerror(errno));
+               ErrPrint("shmdt: %d\n", errno);
        }
 
        if (shmctl(id, IPC_RMID, 0) < 0) {
-               ErrPrint("Remove shm: %s\n", strerror(errno));
+               ErrPrint("shmctl: %d\n", errno);
        }
 
        info->buffer = NULL;
@@ -656,7 +656,7 @@ static inline int unload_pixmap_buffer(struct buffer_info *info)
 
        new_id = strdup(SCHEMA_PIXMAP "0:0");
        if (!new_id) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -1122,7 +1122,7 @@ static inline int sync_for_pixmap(widget_fb_t buffer)
 
        si.shmid = shmget(IPC_PRIVATE, gem->w * gem->h * gem->depth, IPC_CREAT | 0666);
        if (si.shmid < 0) {
-               ErrPrint("shmget: %s\n", strerror(errno));
+               ErrPrint("shmget: %d\n", errno);
                return WIDGET_ERROR_FAULT;
        }
 
@@ -1130,7 +1130,7 @@ static inline int sync_for_pixmap(widget_fb_t buffer)
        si.shmaddr = shmat(si.shmid, NULL, 0);
        if (si.shmaddr == (void *)-1) {
                if (shmctl(si.shmid, IPC_RMID, 0) < 0) {
-                       ErrPrint("shmctl: %s\n", strerror(errno));
+                       ErrPrint("shmctl: %d\n", errno);
                }
                return WIDGET_ERROR_FAULT;
        }
@@ -1144,11 +1144,11 @@ static inline int sync_for_pixmap(widget_fb_t buffer)
        xim = XShmCreateImage(disp, visual, (gem->depth << 3), ZPixmap, NULL, &si, gem->w, gem->h);
        if (xim == NULL) {
                if (shmdt(si.shmaddr) < 0) {
-                       ErrPrint("shmdt: %s\n", strerror(errno));
+                       ErrPrint("shmdt: %d\n", errno);
                }
 
                if (shmctl(si.shmid, IPC_RMID, 0) < 0) {
-                       ErrPrint("shmctl: %s\n", strerror(errno));
+                       ErrPrint("shmctl: %d\n", errno);
                }
                return WIDGET_ERROR_FAULT;
        }
@@ -1163,11 +1163,11 @@ static inline int sync_for_pixmap(widget_fb_t buffer)
                XDestroyImage(xim);
 
                if (shmdt(si.shmaddr) < 0) {
-                       ErrPrint("shmdt: %s\n", strerror(errno));
+                       ErrPrint("shmdt: %d\n", errno);
                }
 
                if (shmctl(si.shmid, IPC_RMID, 0) < 0) {
-                       ErrPrint("shmctl: %s\n", strerror(errno));
+                       ErrPrint("shmctl: %d\n", errno);
                }
 
                return WIDGET_ERROR_FAULT;
@@ -1187,11 +1187,11 @@ static inline int sync_for_pixmap(widget_fb_t buffer)
        XDestroyImage(xim);
 
        if (shmdt(si.shmaddr) < 0) {
-               ErrPrint("shmdt: %s\n", strerror(errno));
+               ErrPrint("shmdt: %d\n", errno);
        }
 
        if (shmctl(si.shmid, IPC_RMID, 0) < 0) {
-               ErrPrint("shmctl: %s\n", strerror(errno));
+               ErrPrint("shmctl: %d\n", errno);
        }
 
        return WIDGET_ERROR_NONE;
@@ -1235,19 +1235,19 @@ EAPI void buffer_handler_flush(struct buffer_info *info)
        } else if (buffer->type == WIDGET_FB_TYPE_FILE) {
                fd = open(widget_util_uri_to_path(info->id), O_WRONLY | O_CREAT, 0644);
                if (fd < 0) {
-                       ErrPrint("%s open falied: %s\n", widget_util_uri_to_path(info->id), strerror(errno));
+                       ErrPrint("%s open: %d\n", widget_util_uri_to_path(info->id), errno);
                        return;
                }
 
                size = info->w * info->h * info->pixel_size;
                widget_service_acquire_lock(info->lock_info);
                if (write(fd, info->buffer, size) != size) {
-                       ErrPrint("Write is not completed: %s\n", strerror(errno));
+                       ErrPrint("write: %d\n", errno);
                }
                widget_service_release_lock(info->lock_info);
 
                if (close(fd) < 0) {
-                       ErrPrint("close: %s\n", strerror(errno));
+                       ErrPrint("close: %d\n", errno);
                }
        } else {
                DbgPrint("Flush nothing\n");
@@ -1292,7 +1292,7 @@ HAPI int buffer_handler_init(void)
        DbgFree(deviceName);
        DbgFree(driverName);
        if (s_info.fd < 0) {
-               ErrPrint("Failed to open a drm device: (%s)\n", strerror(errno));
+               ErrPrint("Failed to open a drm device: (%d)\n", errno);
                s_info.evt_base = 0;
                s_info.err_base = 0;
                return WIDGET_ERROR_NONE;
@@ -1303,7 +1303,7 @@ HAPI int buffer_handler_init(void)
        if (!DRI2Authenticate(ecore_x_display_get(), DefaultRootWindow(ecore_x_display_get()), (unsigned int)magic)) {
                ErrPrint("Failed to do authenticate for DRI2\n");
                if (close(s_info.fd) < 0) {
-                       ErrPrint("close: %s\n", strerror(errno));
+                       ErrPrint("close: %d\n", errno);
                }
                s_info.fd = -1;
                s_info.evt_base = 0;
@@ -1315,7 +1315,7 @@ HAPI int buffer_handler_init(void)
        if (!s_info.slp_bufmgr) {
                ErrPrint("Failed to init bufmgr\n");
                if (close(s_info.fd) < 0) {
-                       ErrPrint("close: %s\n", strerror(errno));
+                       ErrPrint("close: %d\n", errno);
                }
                s_info.fd = -1;
                s_info.evt_base = 0;
@@ -1330,7 +1330,7 @@ HAPI int buffer_handler_fini(void)
 {
        if (s_info.fd >= 0) {
                if (close(s_info.fd) < 0) {
-                       ErrPrint("close: %s\n", strerror(errno));
+                       ErrPrint("close: %d\n", errno);
                }
                s_info.fd = -1;
        }
@@ -1352,26 +1352,26 @@ static inline widget_fb_t raw_open_file(const char *filename)
 
        fd = open(filename, O_RDONLY);
        if (fd < 0) {
-               ErrPrint("open: %s\n", strerror(errno));
+               ErrPrint("open: %d\n", errno);
                return NULL;
        }
 
        off = lseek(fd, 0L, SEEK_END);
        if (off == (off_t)-1) {
-               ErrPrint("lseek: %s\n", strerror(errno));
+               ErrPrint("lseek: %d\n", errno);
 
                if (close(fd) < 0) {
-                       ErrPrint("close: %s\n", strerror(errno));
+                       ErrPrint("close: %d\n", errno);
                }
 
                return NULL;
        }
 
        if (lseek(fd, 0L, SEEK_SET) == (off_t)-1) {
-               ErrPrint("lseek: %s\n", strerror(errno));
+               ErrPrint("lseek: %d\n", errno);
 
                if (close(fd) < 0) {
-                       ErrPrint("close: %s\n", strerror(errno));
+                       ErrPrint("close: %d\n", errno);
                }
 
                return NULL;
@@ -1379,10 +1379,10 @@ static inline widget_fb_t raw_open_file(const char *filename)
 
        buffer = calloc(1, sizeof(*buffer) + off);
        if (!buffer) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("Heap: %d\n", errno);
 
                if (close(fd) < 0) {
-                       ErrPrint("close: %s\n", strerror(errno));
+                       ErrPrint("close: %d\n", errno);
                }
 
                return NULL;
@@ -1395,18 +1395,18 @@ static inline widget_fb_t raw_open_file(const char *filename)
 
        ret = read(fd, buffer->data, off);
        if (ret < 0) {
-               ErrPrint("read: %s\n", strerror(errno));
+               ErrPrint("read: %d\n", errno);
                DbgFree(buffer);
 
                if (close(fd) < 0) {
-                       ErrPrint("close: %s\n", strerror(errno));
+                       ErrPrint("close: %d\n", errno);
                }
 
                return NULL;
        }
 
        if (close(fd) < 0) {
-               ErrPrint("close: %s\n", strerror(errno));
+               ErrPrint("close: %d\n", errno);
        }
 
        return buffer;
@@ -1424,7 +1424,7 @@ static inline widget_fb_t raw_open_shm(int shm)
 
        buffer = (widget_fb_t)shmat(shm, NULL, SHM_RDONLY);
        if (buffer == (widget_fb_t)-1) {
-               ErrPrint("shmat: %s\n", strerror(errno));
+               ErrPrint("shmat: %d\n", errno);
                return NULL;
        }
 
@@ -1437,7 +1437,7 @@ static inline int raw_close_shm(widget_fb_t buffer)
 
        ret = shmdt(buffer);
        if (ret < 0) {
-               ErrPrint("shmdt: %s\n", strerror(errno));
+               ErrPrint("shmdt: %d\n", errno);
        }
 
        return ret;
@@ -1449,7 +1449,7 @@ static inline widget_fb_t raw_open_pixmap(unsigned int pixmap)
 
        buffer = calloc(1, sizeof(*buffer) + WIDGET_CONF_DEFAULT_PIXELS);
        if (!buffer) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                return NULL;
        }
 
@@ -1681,7 +1681,7 @@ HAPI struct buffer_info *buffer_handler_create(struct inst_info *inst, enum widg
 
        info = malloc(sizeof(*info));
        if (!info) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                return NULL;
        }
 
@@ -1694,7 +1694,7 @@ HAPI struct buffer_info *buffer_handler_create(struct inst_info *inst, enum widg
 
                info->id = strdup(SCHEMA_SHM "-1");
                if (!info->id) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("strdup: %d\n", errno);
                        DbgFree(info);
                        return NULL;
                }
@@ -1707,7 +1707,7 @@ HAPI struct buffer_info *buffer_handler_create(struct inst_info *inst, enum widg
 
                info->id = strdup(SCHEMA_FILE "/tmp/.live.undefined");
                if (!info->id) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("strdup: %d\n", errno);
                        DbgFree(info);
                        return NULL;
                }
@@ -1715,7 +1715,7 @@ HAPI struct buffer_info *buffer_handler_create(struct inst_info *inst, enum widg
        case WIDGET_FB_TYPE_PIXMAP:
                info->id = strdup(SCHEMA_PIXMAP "0:0");
                if (!info->id) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("strdup: %d\n", errno);
                        DbgFree(info);
                        return NULL;
                }
index b27b858..7c975eb 100644 (file)
@@ -82,7 +82,7 @@ static inline int load_file_buffer(struct buffer_info *info)
        len = strlen(WIDGET_CONF_IMAGE_PATH) + 40;
        new_id = malloc(len);
        if (!new_id) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -133,16 +133,16 @@ static inline int load_shm_buffer(struct buffer_info *info)
 
        id = shmget(IPC_PRIVATE, size + sizeof(*buffer), IPC_CREAT | 0666);
        if (id < 0) {
-               ErrPrint("shmget: %s\n", strerror(errno));
+               ErrPrint("shmget: %d\n", errno);
                return WIDGET_ERROR_FAULT;
        }
 
        buffer = shmat(id, NULL, 0);
        if (buffer == (void *)-1) {
-               ErrPrint("%s shmat: %s\n", info->id, strerror(errno));
+               ErrPrint("%s shmat: %d\n", info->id, errno);
 
                if (shmctl(id, IPC_RMID, 0) < 0) {
-                       ErrPrint("%s shmctl: %s\n", info->id, strerror(errno));
+                       ErrPrint("%s shmctl: %d\n", info->id, errno);
                }
 
                return WIDGET_ERROR_FAULT;
@@ -157,13 +157,13 @@ static inline int load_shm_buffer(struct buffer_info *info)
 
        new_id = malloc(len);
        if (!new_id) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                if (shmdt(buffer) < 0) {
-                       ErrPrint("shmdt: %s\n", strerror(errno));
+                       ErrPrint("shmdt: %d\n", errno);
                }
 
                if (shmctl(id, IPC_RMID, 0) < 0) {
-                       ErrPrint("shmctl: %s\n", strerror(errno));
+                       ErrPrint("shmctl: %d\n", errno);
                }
 
                return WIDGET_ERROR_OUT_OF_MEMORY;
@@ -228,7 +228,7 @@ static inline int unload_file_buffer(struct buffer_info *info)
 
        new_id = strdup(SCHEMA_FILE "/tmp/.live.undefined");
        if (!new_id) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -237,7 +237,7 @@ static inline int unload_file_buffer(struct buffer_info *info)
 
        path = widget_util_uri_to_path(info->id);
        if (path && unlink(path) < 0) {
-               ErrPrint("unlink: %s\n", strerror(errno));
+               ErrPrint("unlink: %s\n", errno);
        }
 
        DbgFree(info->id);
@@ -252,7 +252,7 @@ static inline int unload_shm_buffer(struct buffer_info *info)
 
        new_id = strdup(SCHEMA_SHM "-1");
        if (!new_id) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -269,11 +269,11 @@ static inline int unload_shm_buffer(struct buffer_info *info)
        }
 
        if (shmdt(info->buffer) < 0) {
-               ErrPrint("Detach shm: %s\n", strerror(errno));
+               ErrPrint("shmdt: %d\n", errno);
        }
 
        if (shmctl(id, IPC_RMID, 0) < 0) {
-               ErrPrint("Remove shm: %s\n", strerror(errno));
+               ErrPrint("shmctl: %d\n", errno);
        }
 
        info->buffer = NULL;
@@ -492,19 +492,19 @@ EAPI void buffer_handler_flush(struct buffer_info *info)
        } else if (buffer->type == BUFFER_TYPE_FILE) {
                fd = open(widget_util_uri_to_path(info->id), O_WRONLY | O_CREAT, 0644);
                if (fd < 0) {
-                       ErrPrint("%s open falied: %s\n", widget_util_uri_to_path(info->id), strerror(errno));
+                       ErrPrint("%s open falied: %d\n", widget_util_uri_to_path(info->id), errno);
                        return;
                }
 
                size = info->w * info->h * info->pixel_size;
                widget_service_acquire_lock(info->lock_info);
                if (write(fd, info->buffer, size) != size) {
-                       ErrPrint("Write is not completed: %s\n", strerror(errno));
+                       ErrPrint("write: %d\n", errno);
                }
                widget_service_release_lock(info->lock_info);
 
                if (close(fd) < 0) {
-                       ErrPrint("close: %s\n", strerror(errno));
+                       ErrPrint("close: %d\n", errno);
                }
        } else {
                DbgPrint("Flush nothing\n");
@@ -543,26 +543,26 @@ static inline struct buffer *raw_open_file(const char *filename)
 
        fd = open(filename, O_RDONLY);
        if (fd < 0) {
-               ErrPrint("open: %s\n", strerror(errno));
+               ErrPrint("open: %d\n", errno);
                return NULL;
        }
 
        off = lseek(fd, 0L, SEEK_END);
        if (off == (off_t)-1) {
-               ErrPrint("lseek: %s\n", strerror(errno));
+               ErrPrint("lseek: %d\n", errno);
 
                if (close(fd) < 0) {
-                       ErrPrint("close: %s\n", strerror(errno));
+                       ErrPrint("close: %d\n", errno);
                }
 
                return NULL;
        }
 
        if (lseek(fd, 0L, SEEK_SET) == (off_t)-1) {
-               ErrPrint("lseek: %s\n", strerror(errno));
+               ErrPrint("lseek: %d\n", errno);
 
                if (close(fd) < 0) {
-                       ErrPrint("close: %s\n", strerror(errno));
+                       ErrPrint("close: %d\n", errno);
                }
 
                return NULL;
@@ -570,10 +570,10 @@ static inline struct buffer *raw_open_file(const char *filename)
 
        buffer = calloc(1, sizeof(*buffer) + off);
        if (!buffer) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
 
                if (close(fd) < 0) {
-                       ErrPrint("close: %s\n", strerror(errno));
+                       ErrPrint("close: %d\n", errno);
                }
 
                return NULL;
@@ -586,18 +586,18 @@ static inline struct buffer *raw_open_file(const char *filename)
 
        ret = read(fd, buffer->data, off);
        if (ret < 0) {
-               ErrPrint("read: %s\n", strerror(errno));
+               ErrPrint("read: %d\n", errno);
                DbgFree(buffer);
 
                if (close(fd) < 0) {
-                       ErrPrint("close: %s\n", strerror(errno));
+                       ErrPrint("close: %d\n", errno);
                }
 
                return NULL;
        }
 
        if (close(fd) < 0) {
-               ErrPrint("close: %s\n", strerror(errno));
+               ErrPrint("close: %d\n", errno);
        }
 
        return buffer;
@@ -615,7 +615,7 @@ static inline struct buffer *raw_open_shm(int shm)
 
        buffer = (widget_fb_t)shmat(shm, NULL, SHM_RDONLY);
        if (buffer == (struct buffer *)-1) {
-               ErrPrint("shmat: %s\n", strerror(errno));
+               ErrPrint("shmat: %d\n", errno);
                return NULL;
        }
 
@@ -628,7 +628,7 @@ static inline int raw_close_shm(widget_fb_t buffer)
 
        ret = shmdt(buffer);
        if (ret < 0) {
-               ErrPrint("shmdt: %s\n", strerror(errno));
+               ErrPrint("shmdt: %d\n", errno);
        }
 
        return ret;
@@ -811,7 +811,7 @@ HAPI struct buffer_info *buffer_handler_create(struct inst_info *inst, enum buff
 
        info = malloc(sizeof(*info));
        if (!info) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                return NULL;
        }
 
@@ -824,7 +824,7 @@ HAPI struct buffer_info *buffer_handler_create(struct inst_info *inst, enum buff
 
                info->id = strdup(SCHEMA_SHM "-1");
                if (!info->id) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("strdup: %d\n", errno);
                        DbgFree(info);
                        return NULL;
                }
@@ -837,7 +837,7 @@ HAPI struct buffer_info *buffer_handler_create(struct inst_info *inst, enum buff
 
                info->id = strdup(SCHEMA_FILE "/tmp/.live.undefined");
                if (!info->id) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("strdup: %d\n", errno);
                        DbgFree(info);
                        return NULL;
                }
index d73d2be..a3af83f 100644 (file)
@@ -274,7 +274,7 @@ static inline struct client_node *create_client_data(pid_t pid, const char *dire
 
        client = calloc(1, sizeof(*client));
        if (!client) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                return NULL;
        }
 
@@ -503,7 +503,7 @@ HAPI int client_event_callback_add(struct client_node *client, enum client_event
 
        item = malloc(sizeof(*item));
        if (!item) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -598,13 +598,13 @@ HAPI int client_set_data(struct client_node *client, const char *tag, void *data
 
        item = calloc(1, sizeof(*item));
        if (!item) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
        item->tag = strdup(tag);
        if (!item->tag) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                DbgFree(item);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
@@ -700,7 +700,7 @@ HAPI int client_global_event_handler_add(enum client_global_event event_type, in
 
        handler = malloc(sizeof(*handler));
        if (!handler) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -783,13 +783,13 @@ HAPI int client_subscribe_category(struct client_node *client, const char *categ
 
        item = malloc(sizeof(*item));
        if (!item) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
        item->category = strdup(category);
        if (!item->category) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                DbgFree(item);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
@@ -853,20 +853,20 @@ HAPI int client_subscribe_group(struct client_node *client, const char *cluster,
 
        item = malloc(sizeof(*item));
        if (!item) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
        item->cluster = strdup(cluster);
        if (!item->cluster) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                DbgFree(item);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
        item->category = strdup(category);
        if (!item->category) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                DbgFree(item->cluster);
                DbgFree(item);
                return WIDGET_ERROR_OUT_OF_MEMORY;
index 834bbc4..1276b1d 100644 (file)
@@ -67,7 +67,7 @@ static inline struct command *create_command(struct client_node *client, struct
 
        command = calloc(1, sizeof(*command));
        if (!command) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                return NULL;
        }
 
@@ -227,7 +227,7 @@ HAPI int client_rpc_init(struct client_node *client, int handle)
 
        rpc = calloc(1, sizeof(*rpc));
        if (!rpc) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
index d68ddc1..fce937f 100644 (file)
@@ -73,7 +73,7 @@ static inline void rotate_log(void)
 
                if (s_info.fp) {
                        if (fclose(s_info.fp) != 0) {
-                               ErrPrint("fclose: %s\n", strerror(errno));
+                               ErrPrint("fclose: %d\n", errno);
                        }
                }
 
@@ -147,7 +147,7 @@ HAPI int critical_log_init(const char *name)
 
        s_info.fp = fopen(filename, "w+");
        if (!s_info.fp) {
-               ErrPrint("Failed to open log: %s\n", strerror(errno));
+               ErrPrint("fopen: %d\n", errno);
                DbgFree(s_info.filename);
                s_info.filename = NULL;
                DbgFree(filename);
@@ -169,7 +169,7 @@ HAPI void critical_log_fini(void)
 
        if (s_info.fp) {
                if (fclose(s_info.fp) != 0) {
-                       ErrPrint("fclose: %s\n", strerror(errno));
+                       ErrPrint("fclose: %d\n", errno);
                }
                s_info.fp = NULL;
        }
index 9365708..6d64f1c 100644 (file)
@@ -120,7 +120,7 @@ HAPI int event_init(void)
 
        ret = pthread_mutex_init(&s_info.event_list_lock, NULL);
        if (ret != 0) {
-               ErrPrint("Mutex: %s\n", strerror(ret));
+               ErrPrint("Mutex: %d\n", ret);
                return WIDGET_ERROR_FAULT;
        }
 
@@ -135,7 +135,7 @@ HAPI int event_fini(void)
 
        ret = pthread_mutex_destroy(&s_info.event_list_lock);
        if (ret != 0) {
-               ErrPrint("Mutex destroy failed: %s\n", strerror(ret));
+               ErrPrint("Mutex destroy: %d\n", ret);
        }
 
        return WIDGET_ERROR_NONE;
@@ -164,14 +164,14 @@ static int push_event_item(void)
                CRITICAL_SECTION_END(&s_info.event_list_lock);
 
                if (write(s_info.evt_pipe[PIPE_WRITE], &event_ch, sizeof(event_ch)) != sizeof(event_ch)) {
-                       ErrPrint("Unable to send an event: %s\n", strerror(errno));
+                       ErrPrint("write: %d\n", errno);
                        return WIDGET_ERROR_IO_ERROR;
                }
 
                /* Take a breathe */
                pthread_yield();
        } else {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
        }
 
        return WIDGET_ERROR_NONE;
@@ -184,7 +184,7 @@ static double current_time_get(void)
        if (WIDGET_CONF_USE_GETTIMEOFDAY) {
                struct timeval tv;
                if (gettimeofday(&tv, NULL) < 0) {
-                       ErrPrint("gettimeofday: %s\n", strerror(errno));
+                       ErrPrint("gettimeofday: %d\n", errno);
                        ret = ecore_time_get();
                } else {
                        ret = (double)tv.tv_sec + ((double)tv.tv_usec / 1000000.0f);
@@ -505,7 +505,7 @@ static void *event_thread_main(void *data)
                                DbgPrint("Select receives INTR\n");
                                continue;
                        }
-                       ErrPrint("Error: %s\n", strerror(errno));
+                       ErrPrint("select: %d\n", errno);
                        break;
                } else if (ret == 0) {
                        ErrPrint("Timeout expired\n");
@@ -516,7 +516,7 @@ static void *event_thread_main(void *data)
                if (FD_ISSET(s_info.handle, &set)) {
                        readsize = read(s_info.handle, ptr + offset, sizeof(input_event) - offset);
                        if (readsize < 0) {
-                               ErrPrint("Unable to read device: %s / fd: %d / offset: %d / size: %d - %d\n", strerror(errno), s_info.handle, offset, sizeof(input_event), readsize);
+                               ErrPrint("read: %d / fd: %d / offset: %d / size: %d - %d\n", errno, s_info.handle, offset, sizeof(input_event), readsize);
                                ret = WIDGET_ERROR_FAULT;
                                break;
                        }
@@ -541,7 +541,7 @@ static void *event_thread_main(void *data)
                         * So we have to wait it to be finished.
                         */
                        if (read(s_info.tcb_pipe[PIPE_READ], &event_ch, sizeof(event_ch)) != sizeof(event_ch)) {
-                               ErrPrint("Unable to read TCB_PIPE: %s\n", strerror(errno));
+                               ErrPrint("read: %d\n", errno);
                        }
 
                        ret = WIDGET_ERROR_CANCELED;
@@ -551,7 +551,7 @@ static void *event_thread_main(void *data)
 
        event_ch = EVENT_EXIT;
        if (write(s_info.evt_pipe[PIPE_WRITE], &event_ch, sizeof(event_ch)) != sizeof(event_ch)) {
-               ErrPrint("Unable to send an event: %s\n", strerror(errno));
+               ErrPrint("write: %d\n", errno);
        }
 
        return (void *)ret;
@@ -674,7 +674,7 @@ static Eina_Bool event_read_cb(void *data, Ecore_Fd_Handler *handler)
        }
 
        if (read(fd, &event_ch, sizeof(event_ch)) != sizeof(event_ch)) {
-               ErrPrint("Unable to read event ch: %s\n", strerror(errno));
+               ErrPrint("read: %d\n", errno);
                return ECORE_CALLBACK_CANCEL;
        }
 
@@ -794,30 +794,30 @@ static int event_control_init(void)
 
        s_info.handle = open(WIDGET_CONF_INPUT_PATH, O_RDONLY);
        if (s_info.handle < 0) {
-               ErrPrint("Unable to access the device: %s\n", strerror(errno));
+               ErrPrint("open: %d\n", errno);
                return WIDGET_ERROR_IO_ERROR;
        }
 
        if (fcntl(s_info.handle, F_SETFD, FD_CLOEXEC) < 0) {
-               ErrPrint("Error: %s\n", strerror(errno));
+               ErrPrint("fcntl: %d\n", errno);
        }
 
        if (fcntl(s_info.handle, F_SETFL, O_NONBLOCK) < 0) {
-               ErrPrint("Error: %s\n", strerror(errno));
+               ErrPrint("fcntl: %d\n", errno);
        }
 
        if (WIDGET_CONF_USE_EVENT_TIME && !WIDGET_CONF_USE_GETTIMEOFDAY) {
                DbgPrint("Change timestamp to monotonic\n");
                if (ioctl(s_info.handle, EVIOCSCLOCKID, &clockId) < 0) {
-                       ErrPrint("Error: %s\n", strerror(errno));
+                       ErrPrint("ioctl: %d\n", errno);
                }
        }
 
        status = pipe2(s_info.evt_pipe, O_CLOEXEC);
        if (status < 0) {
-               ErrPrint("Unable to prepare evt pipe: %s\n", strerror(errno));
+               ErrPrint("pipe2: %d\n", errno);
                if (close(s_info.handle) < 0) {
-                       ErrPrint("Failed to close handle: %s\n", strerror(errno));
+                       ErrPrint("close: %d\n", errno);
                }
                s_info.handle = -1;
                return WIDGET_ERROR_FAULT;
@@ -825,9 +825,9 @@ static int event_control_init(void)
 
        status = pipe2(s_info.tcb_pipe, O_CLOEXEC);
        if (status < 0) {
-               ErrPrint("Unable to prepare tcb pipe: %s\n", strerror(errno));
+               ErrPrint("pipe2: %d\n", errno);
                if (close(s_info.handle) < 0) {
-                       ErrPrint("Failed to close handle: %s\n", strerror(errno));
+                       ErrPrint("close: %d\n", errno);
                }
                s_info.handle = -1;
                CLOSE_PIPE(s_info.evt_pipe);
@@ -845,7 +845,7 @@ static int event_control_fini(void)
        DbgPrint("Finalizing event controller\n");
        if (s_info.handle != -1) {
                if (close(s_info.handle) < 0) {
-                       ErrPrint("Unable to release the fd: %s\n", strerror(errno));
+                       ErrPrint("close: %d\n", errno);
                }
 
                s_info.handle = -1;
@@ -887,7 +887,7 @@ int event_activate_thread(enum event_handler_activate_type activate_type)
 
        ret = pthread_create(&s_info.tid, NULL, event_thread_main, NULL);
        if (ret != 0) {
-               ErrPrint("Failed to initiate the thread: %s\n", strerror(ret));
+               ErrPrint("pthread_create: %d\n", ret);
                ecore_main_fd_handler_del(s_info.event_handler);
                s_info.event_handler = NULL;
                return WIDGET_ERROR_FAULT;
@@ -911,12 +911,12 @@ int event_deactivate_thread(enum event_handler_activate_type activate_type)
 
        /* Terminating thread */
        if (write(s_info.tcb_pipe[PIPE_WRITE], &event_ch, sizeof(event_ch)) != sizeof(event_ch)) {
-               ErrPrint("Unable to write tcb_pipe: %s\n", strerror(errno));
+               ErrPrint("write: %d\n", errno);
        }
 
        status = pthread_join(s_info.tid, &ret);
        if (status != 0) {
-               ErrPrint("Failed to join a thread: %s\n", strerror(errno));
+               ErrPrint("pthread_join: %d\n", status);
        } else {
                DbgPrint("Thread returns: %p\n", ret);
        }
@@ -943,7 +943,7 @@ HAPI int event_activate(int x, int y, int (*event_cb)(enum event_state state, st
 
        listener = malloc(sizeof(*listener));
        if (!listener) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
index 332b337..1728ff6 100644 (file)
@@ -73,7 +73,7 @@ static void clear_log_file(struct slave_node *slave)
        }
 
        if (unlink(filename) < 0) {
-               ErrPrint("unlink: %s\n", strerror(errno));
+               ErrPrint("unlink: %d\n", errno);
        }
 }
 
@@ -87,13 +87,13 @@ static char *check_log_file(struct slave_node *slave)
        snprintf(filename, sizeof(filename), "%s/slave.%d", WIDGET_CONF_LOG_PATH, slave_pid(slave));
        fp = fopen(filename, "rt");
        if (!fp) {
-               ErrPrint("No log file found [%s]\n", strerror(errno));
+               ErrPrint("fopen [%d]\n", errno);
                return NULL;
        }
 
        ptr = fgets(libexec, sizeof(libexec), fp);
        if (fclose(fp) != 0) {
-               ErrPrint("fclose: %s\n", strerror(errno));
+               ErrPrint("fclose: %d\n", errno);
        }
 
        if (ptr != libexec) {
index dfb6c5a..7b1ed9f 100644 (file)
@@ -100,7 +100,7 @@ static inline struct request_item *create_request_item(struct tcb *tcb, int type
 
        item = malloc(sizeof(*item));
        if (!item) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                return NULL;
        }
 
@@ -108,7 +108,7 @@ static inline struct request_item *create_request_item(struct tcb *tcb, int type
        case REQUEST_TYPE_FILE:
                item->data.filename = strdup(data);
                if (!item->data.filename) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("strdup: %d\n", errno);
                        DbgFree(item);
                        return NULL;
                }
@@ -290,7 +290,7 @@ static int service_thread_main(struct tcb *tcb, struct packet *packet, void *dat
 
                        ret = write(s_info.request_pipe[PIPE_WRITE], &ch, sizeof(ch));
                        if (ret < 0) {
-                               ErrPrint("write: %s\n", strerror(errno));
+                               ErrPrint("write: %d\n", errno);
 
                                CRITICAL_SECTION_BEGIN(&s_info.request_list_lock);
                                s_info.request_list = eina_list_remove(s_info.request_list, item);
@@ -333,7 +333,7 @@ static int send_file(int handle, const struct request_item *item)
        /* TODO: push a file to the client */
        fd = open(item->data.filename, O_RDONLY);
        if (fd < 0) {
-               ErrPrint("open: %s\n", strerror(errno));
+               ErrPrint("open: %d\n", errno);
                return -EIO;
        }
 
@@ -347,14 +347,14 @@ static int send_file(int handle, const struct request_item *item)
 
        head = malloc(pktsz);
        if (!head) {
-               ErrPrint("heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                ret = -ENOMEM;
                goto errout;
        }
 
        fsize = lseek(fd, 0L, SEEK_END);
        if (fsize == (off_t)-1) {
-               ErrPrint("heap: %s\n", strerror(errno));
+               ErrPrint("lseek: %d\n", errno);
                DbgFree(head);
                ret = -EIO;
                goto errout;
@@ -373,11 +373,11 @@ static int send_file(int handle, const struct request_item *item)
        }
 
        if (lseek(fd, 0L, SEEK_SET) == (off_t)-1) {
-               ErrPrint("seek: %s\n", strerror(errno));
+               ErrPrint("lseek: %s\n", errno);
 
                body = malloc(sizeof(*body));
                if (!body) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("malloc: %d\n", errno);
                        return -ENOMEM;
                }
 
@@ -396,7 +396,7 @@ static int send_file(int handle, const struct request_item *item)
 
        body = malloc(PKT_CHUNKSZ + sizeof(*body));
        if (!body) {
-               ErrPrint("heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                goto errout;
        }
 
@@ -410,7 +410,7 @@ static int send_file(int handle, const struct request_item *item)
 
                ret = read(fd, body->data, body->size); 
                if (ret < 0) {
-                       ErrPrint("read: %s\n", strerror(errno));
+                       ErrPrint("read: %d\n", errno);
                        ret = -EIO;
                        break;
                }
@@ -438,7 +438,7 @@ static int send_file(int handle, const struct request_item *item)
 
 errout:
        if (close(fd) < 0) {
-               ErrPrint("close: %s\n", strerror(errno));
+               ErrPrint("close: %d\n", errno);
        }
 
        return ret;
@@ -471,7 +471,7 @@ static int send_buffer(int handle, const struct request_item *item)
 
        head = malloc(pktsz);
        if (!head) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                (void)buffer_handler_raw_close(buffer);
                return -ENOMEM;
        }
@@ -546,7 +546,7 @@ static void *push_main(void *data)
                                ret = 0;
                                continue;
                        }
-                       ErrPrint("Error: %s\n", strerror(errno));
+                       ErrPrint("select: %d\n", errno);
                        break;
                } else if (ret == 0) {
                        ErrPrint("Timeout\n");
@@ -562,7 +562,7 @@ static void *push_main(void *data)
 
                ret = read(s_info.request_pipe[PIPE_READ], &ch, sizeof(ch));
                if (ret != sizeof(ch)) {
-                       ErrPrint("read: %s\n", strerror(errno));
+                       ErrPrint("read: %d\n", errno);
                        ret = -EFAULT;
                        break;
                }
@@ -620,13 +620,13 @@ int file_service_init(void)
        }
 
        if (pipe2(s_info.request_pipe, O_CLOEXEC) < 0) {
-               ErrPrint("pipe: %s\n", strerror(errno));
+               ErrPrint("pipe: %d\n", errno);
                return WIDGET_ERROR_FAULT;
        }
 
        status = pthread_mutex_init(&s_info.request_list_lock, NULL);
        if (status != 0) {
-               ErrPrint("Failed to create lock: %s\n", strerror(status));
+               ErrPrint("Failed to create lock: %d\n", status);
                CLOSE_PIPE(s_info.request_pipe);
                return WIDGET_ERROR_FAULT;
        }
@@ -637,7 +637,7 @@ int file_service_init(void)
 
                status = pthread_mutex_destroy(&s_info.request_list_lock);
                if (status != 0) {
-                       ErrPrint("Destroy lock: %s\n", strerror(status));
+                       ErrPrint("Destroy lock: %d\n", status);
                }
 
                CLOSE_PIPE(s_info.request_pipe);
@@ -646,14 +646,14 @@ int file_service_init(void)
 
        status = pthread_create(&s_info.push_thid, NULL, push_main, NULL);
        if (status != 0) {
-               ErrPrint("Failed to create a push service: %s\n", strerror(status));
+               ErrPrint("Failed to create a push service: %d\n", status);
 
                service_common_destroy(s_info.svc_ctx);
                s_info.svc_ctx = NULL;
 
                status = pthread_mutex_destroy(&s_info.request_list_lock);
                if (status != 0) {
-                       ErrPrint("Destroy lock: %s\n", strerror(status));
+                       ErrPrint("Destroy lock: %d\n", status);
                }
 
                CLOSE_PIPE(s_info.request_pipe);
@@ -684,17 +684,17 @@ int file_service_fini(void)
        ch = PUSH_EXIT;
        status = write(s_info.request_pipe[PIPE_WRITE], &ch, sizeof(ch));
        if (status != sizeof(ch)) {
-               ErrPrint("write: %s\n", strerror(errno));
+               ErrPrint("write: %d\n", errno);
                /* Forcely terminate the thread */
                status = pthread_cancel(s_info.push_thid);
                if (status != 0) {
-                       ErrPrint("cancel: %s\n", strerror(status));
+                       ErrPrint("cancel: %d\n", status);
                }
        }
 
        status = pthread_join(s_info.push_thid, &retval);
        if (status != 0) {
-               ErrPrint("join: %s\n", strerror(status));
+               ErrPrint("join: %d\n", status);
        }
 
        CRITICAL_SECTION_BEGIN(&s_info.request_list_lock);
@@ -708,7 +708,7 @@ int file_service_fini(void)
 
        status = pthread_mutex_destroy(&s_info.request_list_lock);
        if (status != 0) {
-               ErrPrint("destroy mutex: %s\n", strerror(status));
+               ErrPrint("destroy mutex: %d\n", status);
        }
 
        CLOSE_PIPE(s_info.request_pipe);
index c9d8812..76b99e6 100644 (file)
@@ -78,13 +78,13 @@ HAPI struct context_info *group_create_context_info(struct category *category, c
 
        info = calloc(1, sizeof(*info));
        if (!info) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                return NULL;
        }
 
        info->pkgname = strdup(pkgname);
        if (!info->pkgname) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                DbgFree(info);
                return NULL;
        }
@@ -122,13 +122,13 @@ HAPI struct context_item *group_add_context_item(struct context_info *info, cons
 
        item = calloc(1, sizeof(*item));
        if (!item) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                return NULL;
        }
 
        item->ctx_item = strdup(ctx_item);
        if (!item->ctx_item) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                DbgFree(item);
                return NULL;
        }
@@ -144,20 +144,20 @@ HAPI int group_add_option(struct context_item *item, const char *key, const char
 
        option = calloc(1, sizeof(*option));
        if (!option) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
        option->key = strdup(key);
        if (!option->key) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                DbgFree(option);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
        option->value = strdup(value);
        if (!option->value) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                DbgFree(option->key);
                DbgFree(option);
                return WIDGET_ERROR_OUT_OF_MEMORY;
@@ -192,13 +192,13 @@ HAPI struct cluster *group_create_cluster(const char *name)
 
        cluster = malloc(sizeof(*cluster));
        if (!cluster) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                return NULL;
        }
 
        cluster->name = strdup(name);
        if (!cluster->name) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                DbgFree(cluster);
                return NULL;
        }
@@ -229,13 +229,13 @@ HAPI struct category *group_create_category(struct cluster *cluster, const char
 
        category = malloc(sizeof(*category));
        if (!category) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                return NULL;
        }
 
        category->name = strdup(name);
        if (!category->name) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                DbgFree(category);
                return NULL;
        }
@@ -470,7 +470,7 @@ static inline char *get_token(char *ptr, int *len)
 
        name = malloc(_len + 1);
        if (!name) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                return NULL;
        }
 
index 55b380d..6a0de22 100644 (file)
@@ -232,7 +232,7 @@ static inline void timer_freeze(struct inst_info *inst)
 #else
        struct timeval tv;
        if (gettimeofday(&tv, NULL) < 0) {
-               ErrPrint("gettimeofday: %s\n", strerror(errno));
+               ErrPrint("gettimeofday: %d\n", errno);
                tv.tv_sec = 0;
                tv.tv_usec = 0;
        }
@@ -700,7 +700,7 @@ HAPI int instance_event_callback_add(struct inst_info *inst, enum instance_event
        case INSTANCE_EVENT_DESTROY:
                item = malloc(sizeof(*item));
                if (!item) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("malloc: %d\n", errno);
                        return WIDGET_ERROR_OUT_OF_MEMORY;
                }
 
@@ -890,7 +890,7 @@ static inline int fork_package(struct inst_info *inst, const char *pkgname)
        len = strlen(SCHEMA_FILE "%s%s_%d_%lf.png") + strlen(WIDGET_CONF_IMAGE_PATH) + strlen(package_name(info)) + 50;
        inst->id = malloc(len);
        if (!inst->id) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -924,7 +924,7 @@ HAPI struct inst_info *instance_create(struct client_node *client, double timest
 
        inst = calloc(1, sizeof(*inst));
        if (!inst) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                return NULL;
        }
 
@@ -934,14 +934,14 @@ HAPI struct inst_info *instance_create(struct client_node *client, double timest
 
        inst->content = strdup(content);
        if (!inst->content) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                DbgFree(inst);
                return NULL;
        }
 
        inst->cluster = strdup(cluster);
        if (!inst->cluster) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                DbgFree(inst->content);
                DbgFree(inst);
                return NULL;
@@ -949,7 +949,7 @@ HAPI struct inst_info *instance_create(struct client_node *client, double timest
 
        inst->category = strdup(category);
        if (!inst->category) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                DbgFree(inst->cluster);
                DbgFree(inst->content);
                DbgFree(inst);
@@ -958,7 +958,7 @@ HAPI struct inst_info *instance_create(struct client_node *client, double timest
 
        inst->title = strdup(WIDGET_CONF_DEFAULT_TITLE); /*!< Use the DEFAULT Title "" */
        if (!inst->title) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                DbgFree(inst->category);
                DbgFree(inst->cluster);
                DbgFree(inst->content);
@@ -1095,7 +1095,7 @@ HAPI struct packet *instance_watch_create(const struct packet *packet, const cha
 
        inst = calloc(1, sizeof(*inst));
        if (!inst) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                return NULL;
        }
 
@@ -1353,7 +1353,7 @@ static void reactivate_cb(struct slave_node *slave, const struct packet *packet,
 
                tmp = strdup(content);
                if (!tmp) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("strdup: %d\n", errno);
                        goto out;
                }
 
@@ -1366,7 +1366,7 @@ static void reactivate_cb(struct slave_node *slave, const struct packet *packet,
 
                tmp = strdup(title);
                if (!tmp) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("strdup: %d\n", errno);
                        goto out;
                }
 
@@ -2320,7 +2320,7 @@ HAPI void instance_gbar_updated_by_instance(struct inst_info *inst, const char *
                if (descfile) {
                        inst->gbar.pended_update_desc = strdup(descfile);
                        if (!inst->gbar.pended_update_desc) {
-                               ErrPrint("Heap: %s\n", strerror(errno));
+                               ErrPrint("strdup: %d\n", errno);
                        }
                }
 
@@ -2384,7 +2384,7 @@ HAPI int instance_set_update_mode(struct inst_info *inst, int active_update)
 
        cbdata = malloc(sizeof(*cbdata));
        if (!cbdata) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -2416,14 +2416,14 @@ HAPI void instance_set_widget_info(struct inst_info *inst, double priority, cons
        if (content && strlen(content)) {
                _content = strdup(content);
                if (!_content) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("strdup: %d\n", errno);
                }
        }
 
        if (title && strlen(title)) {
                _title = strdup(title);
                if (!_title) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("strdup: %d\n", errno);
                }
        }
 
@@ -2450,14 +2450,14 @@ HAPI void instance_set_alt_info(struct inst_info *inst, const char *icon, const
        if (icon && strlen(icon)) {
                _icon = strdup(icon);
                if (!_icon) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("strdup: %d\n", errno);
                }
        }
 
        if (name && strlen(name)) {
                _name = strdup(name);
                if (!_name) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("strdup: %d\n", errno);
                }
        }
 
@@ -2523,7 +2523,7 @@ static void pinup_cb(struct slave_node *slave, const struct packet *packet, void
 
                new_content = strdup(content);
                if (!new_content) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("strdup: %d\n", errno);
                        /*!
                         * \note
                         * send pinup failed event to client
@@ -2754,7 +2754,7 @@ HAPI int instance_resize(struct inst_info *inst, int w, int h)
 
        cbdata = malloc(sizeof(*cbdata));
        if (!cbdata) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -2881,7 +2881,7 @@ HAPI int instance_set_period(struct inst_info *inst, double period)
 
        cbdata = malloc(sizeof(*cbdata));
        if (!cbdata) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -3060,20 +3060,20 @@ HAPI int instance_change_group(struct inst_info *inst, const char *cluster, cons
 
        cbdata = malloc(sizeof(*cbdata));
        if (!cbdata) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("mlloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
        cbdata->cluster = strdup(cluster);
        if (!cbdata->cluster) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                DbgFree(cbdata);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
        cbdata->category = strdup(category);
        if (!cbdata->category) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                DbgFree(cbdata->cluster);
                DbgFree(cbdata);
                return WIDGET_ERROR_OUT_OF_MEMORY;
@@ -3815,13 +3815,13 @@ HAPI int instance_set_data(struct inst_info *inst, const char *tag, void *data)
        if (!item) {
                item = malloc(sizeof(*item));
                if (!item) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("malloc: %d\n", errno);
                        return WIDGET_ERROR_OUT_OF_MEMORY;
                }
 
                item->tag = strdup(tag);
                if (!item->tag) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("strdup: %d\n", errno);
                        DbgFree(item);
                        return WIDGET_ERROR_OUT_OF_MEMORY;
                }
index 3d7011d..9f59fdd 100644 (file)
--- a/src/io.c
+++ b/src/io.c
@@ -494,7 +494,7 @@ HAPI char *io_widget_pkgname(const char *pkgname)
        if (tmp && strlen(tmp)) {
                pkgid = strdup(tmp);
                if (!pkgid) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("strdup: %d\n", errno);
                }
        }
 
@@ -549,7 +549,7 @@ HAPI int io_crawling_widgetes(int (*cb)(const char *pkgid, const char *lbid, int
 
        dir = opendir(WIDGET_CONF_ROOT_PATH);
        if (!dir) {
-               ErrPrint("Error: %s\n", strerror(errno));
+               ErrPrint("opendir: %d\n", errno);
        } else {
                struct dirent *ent;
 
@@ -560,14 +560,14 @@ HAPI int io_crawling_widgetes(int (*cb)(const char *pkgid, const char *lbid, int
 
                        if (cb(ent->d_name, ent->d_name, -2, data) < 0) {
                                if (closedir(dir) < 0) {
-                                       ErrPrint("closedir: %s\n", strerror(errno));
+                                       ErrPrint("closedir: %d\n", errno);
                                }
                                return WIDGET_ERROR_CANCELED;
                        }
                }
 
                if (closedir(dir) < 0) {
-                       ErrPrint("closedir: %s\n", strerror(errno));
+                       ErrPrint("closedir: %d\n", errno);
                }
        }
 
@@ -669,9 +669,9 @@ static inline int db_init(void)
        }
 
        if (lstat(WIDGET_CONF_DBFILE, &stat) < 0) {
+               ErrPrint("lstat: %d\n", errno);
                db_util_close(s_info.handle);
                s_info.handle = NULL;
-               ErrPrint("%s\n", strerror(errno));
                return WIDGET_ERROR_IO_ERROR;
        }
 
index b5e5c88..429d881 100644 (file)
@@ -77,7 +77,7 @@ static inline int app_create(void)
 
        if (access(WIDGET_CONF_LOG_PATH, R_OK | W_OK) != 0) {
                if (mkdir(WIDGET_CONF_LOG_PATH, 0755) < 0) {
-                       ErrPrint("Failed to create %s (%s)\n", WIDGET_CONF_LOG_PATH, strerror(errno));
+                       ErrPrint("mkdir %s (%d)\n", WIDGET_CONF_LOG_PATH, errno);
                }
        }
 
@@ -289,7 +289,7 @@ static Eina_Bool signal_cb(void *data, Ecore_Fd_Handler *handler)
 
        size = read(fd, &fdsi, sizeof(fdsi));
        if (size != sizeof(fdsi)) {
-               ErrPrint("Unable to get siginfo: %s\n", strerror(errno));
+               ErrPrint("read: %d\n", errno);
                ecore_main_fd_handler_del(handler);
                return ECORE_CALLBACK_CANCEL;
        }
@@ -301,7 +301,7 @@ static Eina_Bool signal_cb(void *data, Ecore_Fd_Handler *handler)
 
                cfd = creat("/tmp/.stop.provider", 0644);
                if (cfd < 0 || close(cfd) < 0) {
-                       ErrPrint("stop.provider: %s\n", strerror(errno));
+                       ErrPrint("stop.provider: %d\n", errno);
                }
 
                vconf_set_bool(VCONFKEY_MASTER_STARTED, 0);
@@ -395,27 +395,27 @@ int main(int argc, char *argv[])
 
        ret = sigaddset(&mask, SIGTERM);
        if (ret < 0) {
-               CRITICAL_LOG("Failed to do sigemptyset: %s\n", strerror(errno));
+               CRITICAL_LOG("sigaddset: %d\n", errno);
        }
 
        ret = sigaddset(&mask, SIGUSR1);
        if (ret < 0) {
-               CRITICAL_LOG("Failed to do sigemptyset: %s\n", strerror(errno));
+               CRITICAL_LOG("sigaddset: %d\n", errno);
        }
 
        ret = sigaddset(&mask, SIGUSR2);
        if (ret < 0) {
-               CRITICAL_LOG("Failed to do sigemptyset: %s\n", strerror(errno));
+               CRITICAL_LOG("sigaddset: %d\n", errno);
        }
 
        ret = sigprocmask(SIG_BLOCK, &mask, NULL);
        if (ret < 0) {
-               CRITICAL_LOG("Failed to mask the SIGTERM: %s\n", strerror(errno));
+               CRITICAL_LOG("sigprocmask: %d\n", errno);
        }
 
        ret = signalfd(-1, &mask, 0);
        if (ret < 0) {
-               CRITICAL_LOG("Failed to initiate the signalfd: %s\n", strerror(errno));
+               CRITICAL_LOG("signalfd: %d\n", errno);
        } else {
                signal_handler = ecore_main_fd_handler_add(ret, ECORE_FD_READ, signal_cb, NULL, NULL, NULL);
                CRITICAL_LOG("Signal handler initiated: %d\n", ret);
index 46f03c6..048d49d 100644 (file)
@@ -328,13 +328,13 @@ static inline int load_conf(struct pkg_info *info)
 
                info->script = strdup(WIDGET_CONF_DEFAULT_SCRIPT);
                if (!info->script) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("strdup: %d\n", errno);
                        return WIDGET_ERROR_OUT_OF_MEMORY;
                }
 
                info->abi = strdup(WIDGET_CONF_DEFAULT_ABI);
                if (!info->abi) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("strdup: %d\n", errno);
                        DbgFree(info->script);
                        info->script = NULL;
                        return WIDGET_ERROR_OUT_OF_MEMORY;
@@ -358,7 +358,7 @@ static inline int load_conf(struct pkg_info *info)
 
                        info->widget.info.script.path = strdup(str);
                        if (!info->widget.info.script.path) {
-                               ErrPrint("Heap: %s\n", strerror(errno));
+                               ErrPrint("strdup: %d\n", errno);
                                parser_unload(parser);
                                return WIDGET_ERROR_OUT_OF_MEMORY;
                        }
@@ -367,7 +367,7 @@ static inline int load_conf(struct pkg_info *info)
                        if (str) {
                                info->widget.info.script.group = strdup(str);
                                if (!info->widget.info.script.group) {
-                                       ErrPrint("Heap: %s\n", strerror(errno));
+                                       ErrPrint("strdup: %d\n", errno);
                                        DbgFree(info->widget.info.script.path);
                                        parser_unload(parser);
                                        return WIDGET_ERROR_OUT_OF_MEMORY;
@@ -386,7 +386,7 @@ static inline int load_conf(struct pkg_info *info)
                        info->gbar.type = GBAR_TYPE_SCRIPT;
                        info->gbar.info.script.path = strdup(str);
                        if (!info->gbar.info.script.path) {
-                               ErrPrint("Heap: %s\n", strerror(errno));
+                               ErrPrint("strdup: %d\n", errno);
                                if (info->widget.type == WIDGET_TYPE_SCRIPT) {
                                        DbgFree(info->widget.info.script.path);
                                        DbgFree(info->widget.info.script.group);
@@ -399,7 +399,7 @@ static inline int load_conf(struct pkg_info *info)
                        if (str) {
                                info->gbar.info.script.group = strdup(str);
                                if (!info->gbar.info.script.group) {
-                                       ErrPrint("Heap: %s\n", strerror(errno));
+                                       ErrPrint("strdup: %d\n", errno);
                                        DbgFree(info->gbar.info.script.path);
                                        if (info->widget.type == WIDGET_TYPE_SCRIPT) {
                                                DbgFree(info->widget.info.script.path);
@@ -416,7 +416,7 @@ static inline int load_conf(struct pkg_info *info)
        str = str ? str : WIDGET_CONF_DEFAULT_SCRIPT;
        info->script = strdup(str);
        if (!info->script) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                if (info->gbar.type == GBAR_TYPE_SCRIPT) {
                        DbgFree(info->gbar.info.script.path);
                        DbgFree(info->gbar.info.script.group);
@@ -435,7 +435,7 @@ static inline int load_conf(struct pkg_info *info)
        str = str ? str : WIDGET_CONF_DEFAULT_ABI;
        info->abi = strdup(str);
        if (!info->abi) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                DbgFree(info->script);
                if (info->gbar.type == GBAR_TYPE_SCRIPT) {
                        DbgFree(info->gbar.info.script.path);
@@ -466,7 +466,7 @@ static inline int load_conf(struct pkg_info *info)
        str = str ? str : "";
        info->widget.auto_launch = strdup(str);
        if (!info->widget.auto_launch) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                DbgFree(info->abi);
                DbgFree(info->script);
                if (info->gbar.type == GBAR_TYPE_SCRIPT) {
@@ -502,13 +502,13 @@ HAPI struct pkg_info *package_create(const char *pkgid, const char *widget_id)
 
        pkginfo = calloc(1, sizeof(*pkginfo));
        if (!pkginfo) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                return NULL;
        }
 
        pkginfo->pkgid = strdup(pkgid);
        if (!pkginfo->pkgid) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                DbgFree(pkginfo);
                return NULL;
        }
@@ -518,7 +518,7 @@ HAPI struct pkg_info *package_create(const char *pkgid, const char *widget_id)
                ErrPrint("Failed to get pkgname, fallback to fs checker\n");
                pkginfo->widget_id = strdup(widget_id);
                if (!pkginfo->widget_id) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("strdup: %d\n", errno);
                        DbgFree(pkginfo->pkgid);
                        DbgFree(pkginfo);
                        return NULL;
@@ -572,7 +572,7 @@ HAPI char *package_widget_pkgname(const char *pkgname)
        if (!widget_id) {
                widget_id = strdup(pkgname);
                if (!widget_id) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("strdup: %d\n", errno);
                        return NULL;
                }
        }
@@ -712,7 +712,7 @@ HAPI int package_set_fault_info(struct pkg_info *info, double timestamp, const c
 
        fault = calloc(1, sizeof(*fault));
        if (!fault) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -726,14 +726,14 @@ HAPI int package_set_fault_info(struct pkg_info *info, double timestamp, const c
 
        fault->filename = strdup(filename);
        if (!fault->filename) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                DbgFree(fault);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
        fault->function = strdup(function);
        if (!fault->function) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                DbgFree(fault->filename);
                DbgFree(fault);
                return WIDGET_ERROR_OUT_OF_MEMORY;
@@ -809,7 +809,7 @@ HAPI int package_set_script(struct pkg_info *info, const char *script)
 
        tmp = strdup(script);
        if (!tmp) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -828,7 +828,7 @@ HAPI int package_set_abi(struct pkg_info *info, const char *abi)
        char *tmp;
        tmp = strdup(abi);
        if (!tmp) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -856,7 +856,7 @@ HAPI int package_set_widget_path(struct pkg_info *info, const char *path)
 
        tmp = strdup(path);
        if (!tmp) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -884,7 +884,7 @@ HAPI int package_set_widget_group(struct pkg_info *info, const char *group)
 
        tmp = strdup(group);
        if (!tmp) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -912,7 +912,7 @@ HAPI int package_set_gbar_path(struct pkg_info *info, const char *path)
 
        tmp = strdup(path);
        if (!tmp) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -940,7 +940,7 @@ HAPI int package_set_gbar_group(struct pkg_info *info, const char *group)
 
        tmp = strdup(group);
        if (!tmp) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -972,7 +972,7 @@ HAPI void package_set_auto_launch(struct pkg_info *info, const char *auto_launch
 
        info->widget.auto_launch = strdup(auto_launch);
        if (!info->widget.auto_launch) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                return;
        }
 }
@@ -1055,7 +1055,7 @@ HAPI int package_set_libexec(struct pkg_info *info, const char *libexec)
 
        tmp = strdup(libexec);
        if (!tmp) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -1109,7 +1109,7 @@ HAPI int package_set_hw_acceleration(struct pkg_info *info, const char *hw_accel
 
        tmp = strdup(hw_acceleration);
        if (!tmp) {
-               ErrPrint("strdup: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -1128,7 +1128,7 @@ HAPI int package_set_category(struct pkg_info *info, const char *category)
 
        tmp = strdup(category);
        if (!tmp) {
-               ErrPrint("strdup: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -1710,7 +1710,7 @@ HAPI char *package_get_pkgid(const char *appid)
        if (new_appid && new_appid[0] != '\0') {
                pkgid = strdup(new_appid);
                if (!pkgid) {
-                       ErrPrint("strdup: %s\n", strerror(errno));
+                       ErrPrint("strdup: %d\n", errno);
                }
        }
        pkgmgrinfo_appinfo_destroy_appinfo(handle);
index e283648..ecdac56 100644 (file)
@@ -363,7 +363,7 @@ static inline char *dup_rtrim(char *buffer)
 
        ret = strdup(buffer);
        if (!ret) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                return NULL;
        }
 
@@ -407,7 +407,7 @@ static void auto_launch_handler(struct parser *item, char *buffer)
 
        item->auto_launch = strdup(buffer);
        if (!item->auto_launch) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                return;
        }
 }
@@ -490,7 +490,7 @@ static void widget_path_handler(struct parser *item, char *buffer)
 
        item->widget_path = dup_rtrim(buffer);
        if (!item->widget_path) {
-               ErrPrint("Error: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
        }
 }
 
@@ -502,7 +502,7 @@ static void group_handler(struct parser *item, char *buffer)
 
        item->group = dup_rtrim(buffer);
        if (!item->group) {
-               ErrPrint("Error: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
        }
 }
 
@@ -523,7 +523,7 @@ static void widget_group_handler(struct parser *item, char *buffer)
 
        item->widget_group = dup_rtrim(buffer);
        if (!item->widget_group) {
-               ErrPrint("Error: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
        }
 }
 
@@ -535,7 +535,7 @@ static void gbar_path_handler(struct parser *item, char *buffer)
 
        item->gbar_path = dup_rtrim(buffer);
        if (!item->gbar_path) {
-               ErrPrint("Error: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
        }
 }
 
@@ -547,7 +547,7 @@ static void gbar_group_handler(struct parser *item, char *buffer)
 
        item->gbar_group = dup_rtrim(buffer);
        if (!item->gbar_group) {
-               ErrPrint("Error: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
        }
 }
 
@@ -668,14 +668,14 @@ HAPI struct parser *parser_load(const char *pkgname)
        len = strlen(WIDGET_CONF_CONF_PATH) + strlen(pkgname) * 2;
        item->filename = malloc(len);
        if (!item->filename) {
-               ErrPrint("Error: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                DbgFree(item);
                return 0;
        }
 
        ret = snprintf(item->filename, len, WIDGET_CONF_CONF_PATH, pkgname, pkgname);
        if (ret < 0) {
-               ErrPrint("Error: %s\n", strerror(errno));
+               ErrPrint("snprintf: %d\n", errno);
                DbgFree(item->filename);
                DbgFree(item);
                return 0;
@@ -865,7 +865,7 @@ HAPI struct parser *parser_load(const char *pkgname)
        } while (c != EOF);
 
        if (fclose(fp) != 0) {
-               ErrPrint("fclose: %s\n", strerror(errno));
+               ErrPrint("fclose: %d\n", errno);
        }
 
        s_list = eina_list_append(s_list, item);
index 8463ff1..5d2fb17 100644 (file)
@@ -202,13 +202,13 @@ static int start_cb(const char *pkgname, const char *val, void *data)
 
        item = calloc(1, sizeof(*item));
        if (!item) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
        item->pkgname = strdup(pkgname);
        if (!item->pkgname) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                DbgFree(item);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
@@ -255,7 +255,7 @@ static int icon_path_cb(const char *pkgname, const char *val, void *data)
 
        item->icon = strdup(val);
        if (!item->icon) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -314,7 +314,7 @@ static int change_pkgname_cb(const char *pkgname, const char *val, void *data)
 
        new_pkgname = strdup(val);
        if (!new_pkgname) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -527,7 +527,7 @@ HAPI int pkgmgr_add_event_callback(enum pkgmgr_event_type type, int (*cb)(const
 
        item = calloc(1, sizeof(*item));
        if (!item) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
index 32a306c..4aec836 100644 (file)
@@ -179,7 +179,7 @@ static int load_all_ports(void)
 
        dir = opendir(WIDGET_CONF_SCRIPT_PORT_PATH);
        if (!dir) {
-               ErrPrint("Error: %s\n", strerror(errno));
+               ErrPrint("opendir: %d\n", errno);
                return WIDGET_ERROR_IO_ERROR;
        }
 
@@ -191,9 +191,9 @@ static int load_all_ports(void)
                pathlen = strlen(ent->d_name) + strlen(WIDGET_CONF_SCRIPT_PORT_PATH) + 1;
                path = malloc(pathlen);
                if (!path) {
-                       ErrPrint("Heap: %s %d\n", strerror(errno), pathlen);
+                       ErrPrint("malloc: %d %d\n", errno, pathlen);
                        if (closedir(dir) < 0) {
-                               ErrPrint("closedir: %s\n", strerror(errno));
+                               ErrPrint("closedir: %d\n", errno);
                        }
                        return WIDGET_ERROR_OUT_OF_MEMORY;
                }
@@ -202,10 +202,10 @@ static int load_all_ports(void)
 
                item = malloc(sizeof(*item));
                if (!item) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("malloc: %d\n", errno);
                        DbgFree(path);
                        if (closedir(dir) < 0) {
-                               ErrPrint("closedir: %s\n", strerror(errno));
+                               ErrPrint("closedir: %d\n", errno);
                        }
                        return WIDGET_ERROR_OUT_OF_MEMORY;
                }
@@ -217,7 +217,7 @@ static int load_all_ports(void)
                        ErrPrint("Error: %s\n", dlerror());
                        DbgFree(item);
                        if (closedir(dir) < 0) {
-                               ErrPrint("closedir: %s\n", strerror(errno));
+                               ErrPrint("closedir: %d\n", errno);
                        }
                        return WIDGET_ERROR_FAULT;
                }
@@ -323,7 +323,7 @@ static int load_all_ports(void)
        }
 
        if (closedir(dir) < 0) {
-               ErrPrint("closedir: %s\n", strerror(errno));
+               ErrPrint("closedir: %d\n", errno);
        }
 
        return WIDGET_ERROR_NONE;
@@ -331,11 +331,11 @@ static int load_all_ports(void)
 errout:
        ErrPrint("Error: %s\n", dlerror());
        if (dlclose(item->handle) != 0) {
-               ErrPrint("dlclose: %s\n", strerror(errno));
+               ErrPrint("dlclose: %d\n", errno);
        }
        DbgFree(item);
        if (closedir(dir) < 0) {
-               ErrPrint("closedir: %s\n", strerror(errno));
+               ErrPrint("closedir: %d\n", errno);
        }
        return WIDGET_ERROR_FAULT;
 }
@@ -551,7 +551,7 @@ HAPI struct script_info *script_handler_create(struct inst_info *inst, const cha
 
        info = calloc(1, sizeof(*info));
        if (!info) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                return NULL;
        }
 
@@ -1050,7 +1050,7 @@ HAPI int script_fini(void)
        EINA_LIST_FREE(s_info.script_port_list, item) {
                item->fini();
                if (dlclose(item->handle) != 0) {
-                       ErrPrint("dlclose: %s\n", strerror(errno));
+                       ErrPrint("dlclose: %d\n", errno);
                }
                DbgFree(item);
        }
@@ -1110,24 +1110,24 @@ static inline char *load_file(const char *filename)
 
        fd = open(filename, O_RDONLY);
        if (fd < 0) {
-               ErrPrint("open: %s\n", strerror(errno));
+               ErrPrint("open: %d\n", errno);
                return NULL;
        }
 
        filesize = lseek(fd, 0L, SEEK_END);
        if (filesize == (off_t)-1) {
-               ErrPrint("lseek: %s\n", strerror(errno));
+               ErrPrint("lseek: %d\n", errno);
                goto errout;
        }
 
        if (lseek(fd, 0L, SEEK_SET) < 0) {
-               ErrPrint("lseek: %s\n", strerror(errno));
+               ErrPrint("lseek: %d\n", errno);
                goto errout;
        }
 
        filebuf = malloc(filesize + 1);
        if (!filebuf) {
-               ErrPrint("malloc: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                goto errout;
        }
 
@@ -1139,7 +1139,7 @@ static inline char *load_file(const char *filename)
                                continue;
                        }
 
-                       ErrPrint("read: %s\n", strerror(errno));
+                       ErrPrint("read: %d\n", errno);
                        free(filebuf);
                        filebuf = NULL;
                        break;
@@ -1159,7 +1159,7 @@ static inline char *load_file(const char *filename)
 
 errout:
        if (close(fd) < 0) {
-               ErrPrint("close: %s\n", strerror(errno));
+               ErrPrint("close: %d\n", errno);
        }
 
        return filebuf;
@@ -1226,7 +1226,7 @@ HAPI int script_handler_parse_desc(struct inst_info *inst, const char *filename,
                        if (*fileptr == '{') {
                                block = calloc(1, sizeof(*block));
                                if (!block) {
-                                       ErrPrint("calloc: %s\n", strerror(errno));
+                                       ErrPrint("calloc: %d\n", errno);
                                        state = ERROR;
                                        continue;
                                }
@@ -1485,7 +1485,7 @@ HAPI int script_handler_parse_desc(struct inst_info *inst, const char *filename,
                        }
                }
        } else {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                EINA_LIST_FREE(block_list, block) {
                        consuming_parsed_block(inst, is_pd, block);
                }
index ae8e94d..e2f8c2f 100644 (file)
@@ -1189,7 +1189,7 @@ static struct packet *client_delete(pid_t pid, int handle, const struct packet *
 
                        item = malloc(sizeof(*item));
                        if (!item) {
-                               ErrPrint("Heap: %s\n", strerror(errno));
+                               ErrPrint("malloc: %d\n", errno);
                                ret = WIDGET_ERROR_OUT_OF_MEMORY;
                        } else {
                                /*!
@@ -7071,7 +7071,7 @@ static struct packet *slave_updated(pid_t pid, int handle, const struct packet *
                        }
 
                        if (unlink(safe_filename) < 0) {
-                               ErrPrint("unlink: %s - %s\n", strerror(errno), safe_filename);
+                               ErrPrint("unlink: %d - %s\n", errno, safe_filename);
                        }
                        break;
                case WIDGET_TYPE_BUFFER:
@@ -7878,7 +7878,7 @@ static struct packet *slave_hello_sync_prepare(pid_t pid, int handle, const stru
        } else {
                ctx = calloc(1, sizeof(*ctx));
                if (!ctx) {
-                       ErrPrint("calloc: %s\n", strerror(errno));
+                       ErrPrint("calloc: %d\n", errno);
                        goto out;
                }
 
@@ -7886,7 +7886,7 @@ static struct packet *slave_hello_sync_prepare(pid_t pid, int handle, const stru
 
                ctx->pkgname = strdup(pkgname);
                if (!ctx->pkgname) {
-                       ErrPrint("strdup: %s\n", strerror(errno));
+                       ErrPrint("strdup: %d\n", errno);
                        DbgFree(ctx);
                        goto out;
                }
@@ -7989,13 +7989,13 @@ static struct packet *slave_hello_sync(pid_t pid, int handle, const struct packe
 
                        item = calloc(1, sizeof(*item));
                        if (!item) {
-                               ErrPrint("calloc: %s\n", strerror(errno));
+                               ErrPrint("calloc: %d\n", errno);
                                goto out;
                        }
 
                        item->pkgname = strdup(pkgname);
                        if (!item->pkgname) {
-                               ErrPrint("strdup: %s\n", strerror(errno));
+                               ErrPrint("strdup: %d\n", errno);
                                DbgFree(item);
                                goto out;
                        }
@@ -9453,19 +9453,19 @@ HAPI int server_init(void)
        com_core_packet_use_thread(WIDGET_CONF_COM_CORE_THREAD);
 
        if (unlink(INFO_SOCKET) < 0) {
-               ErrPrint("info socket: %s\n", strerror(errno));
+               ErrPrint("unlink info: %d\n", errno);
        }
 
        if (unlink(SLAVE_SOCKET) < 0) {
-               ErrPrint("slave socket: %s\n", strerror(errno));
+               ErrPrint("unlink slave: %d\n", errno);
        }
 
        if (unlink(CLIENT_SOCKET) < 0) {
-               ErrPrint("client socket: %s\n", strerror(errno));
+               ErrPrint("unlink client: %d\n", errno);
        }
 
        if (unlink(SERVICE_SOCKET) < 0) {
-               ErrPrint("service socket: %s\n", strerror(errno));
+               ErrPrint("unlink service: %d\n", errno);
        }
 
        s_info.info_fd = com_core_packet_server_init(INFO_SOCKET, s_info_table);
@@ -9499,19 +9499,19 @@ HAPI int server_init(void)
        }
 
        if (chmod(INFO_SOCKET, 0600) < 0) {
-               ErrPrint("info socket: %s\n", strerror(errno));
+               ErrPrint("chmod info: %d\n", errno);
        }
 
        if (chmod(SLAVE_SOCKET, 0666) < 0) {
-               ErrPrint("slave socket: %s\n", strerror(errno));
+               ErrPrint("chmod slave: %d\n", errno);
        }
 
        if (chmod(CLIENT_SOCKET, 0666) < 0) {
-               ErrPrint("client socket: %s\n", strerror(errno));
+               ErrPrint("chmod client: %d\n", errno);
        }
 
        if (chmod(SERVICE_SOCKET, 0666) < 0) {
-               ErrPrint("service socket: %s\n", strerror(errno));
+               ErrPrint("chmod service: %d\n", errno);
        }
 
        return 0;
index 2f5758e..d250eba 100644 (file)
@@ -158,7 +158,7 @@ static void *client_packet_pump_main(void *data)
                                ret = 0;
                                continue;
                        }
-                       ErrPrint("Error: %s\n", strerror(errno));
+                       ErrPrint("select: %d\n", errno);
                        DbgFree(ptr);
                        ptr = NULL;
                        break;
@@ -198,7 +198,7 @@ static void *client_packet_pump_main(void *data)
                        packet = NULL;
                        ptr = malloc(size);
                        if (!ptr) {
-                               ErrPrint("Heap: %s\n", strerror(errno));
+                               ErrPrint("malloc: %d\n", errno);
                                ret = -ENOMEM;
                                break;
                        }
@@ -241,7 +241,7 @@ static void *client_packet_pump_main(void *data)
 
                                ptr = malloc(size);
                                if (!ptr) {
-                                       ErrPrint("Heap: %s\n", strerror(errno));
+                                       ErrPrint("malloc: %d\n", errno);
                                        ret = -ENOMEM;
                                }
                        }
@@ -289,7 +289,7 @@ static void *client_packet_pump_main(void *data)
                        packet_info = malloc(sizeof(*packet_info));
                        if (!packet_info) {
                                ret = -errno;
-                               ErrPrint("Heap: %s\n", strerror(errno));
+                               ErrPrint("malloc: %d\n", errno);
                                packet_destroy(packet);
                                break;
                        }
@@ -303,7 +303,7 @@ static void *client_packet_pump_main(void *data)
 
                        if (write(svc_ctx->evt_pipe[PIPE_WRITE], &evt_ch, sizeof(evt_ch)) != sizeof(evt_ch)) {
                                ret = -errno;
-                               ErrPrint("Unable to write a pipe: %s\n", strerror(errno));
+                               ErrPrint("write: %d\n", errno);
                                CRITICAL_SECTION_BEGIN(&svc_ctx->packet_list_lock);
                                svc_ctx->packet_list = eina_list_remove(svc_ctx->packet_list, packet_info);
                                CRITICAL_SECTION_END(&svc_ctx->packet_list_lock);
@@ -336,7 +336,7 @@ static void *client_packet_pump_main(void *data)
         * Emit a signal to collect this TCB from the SERVER THREAD.
         */
        if (write(svc_ctx->tcb_pipe[PIPE_WRITE], &tcb, sizeof(tcb)) != sizeof(tcb)) {
-               ErrPrint("Unable to write pipe: %s\n", strerror(errno));
+               ErrPrint("write: %d\n", errno);
        }
 
        return (void *)ret;
@@ -352,7 +352,7 @@ HAPI int service_register_tcb_callback(struct service_context *svc_ctx, struct t
 
        cbdata = malloc(sizeof(*cbdata));
        if (!cbdata) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -427,12 +427,12 @@ static inline struct tcb *tcb_create(struct service_context *svc_ctx, int fd)
 
        tcb = malloc(sizeof(*tcb));
        if (!tcb) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                return NULL;
        }
 
        if (pipe2(tcb->ctrl_pipe, O_CLOEXEC) < 0) {
-               ErrPrint("pipe2: %s\n", strerror(errno));
+               ErrPrint("pipe2: %d\n", errno);
                DbgFree(tcb);
                return NULL;
        }
@@ -445,7 +445,7 @@ static inline struct tcb *tcb_create(struct service_context *svc_ctx, int fd)
        DbgPrint("Create a new service thread [%d]\n", fd);
        status = pthread_create(&tcb->thid, NULL, client_packet_pump_main, tcb);
        if (status != 0) {
-               ErrPrint("Unable to create a new thread: %s\n", strerror(status));
+               ErrPrint("pthread_create: %d\n", status);
                CLOSE_PIPE(tcb->ctrl_pipe);
                DbgFree(tcb);
                return NULL;
@@ -491,12 +491,12 @@ static inline void tcb_teminate_all(struct service_context *svc_ctx)
                 * ASSERT(tcb->fd >= 0);
                 */
                if (write(tcb->ctrl_pipe[PIPE_WRITE], &ch, sizeof(ch)) != sizeof(ch)) {
-                       ErrPrint("write: %s\n", strerror(errno));
+                       ErrPrint("write: %d\n", errno);
                }
 
                status = pthread_join(tcb->thid, &ret);
                if (status != 0) {
-                       ErrPrint("Unable to join a thread: %s\n", strerror(status));
+                       ErrPrint("Unable to join a thread: %d\n", status);
                } else {
                        DbgPrint("Thread returns: %p\n", ret);
                }
@@ -550,12 +550,12 @@ static inline void tcb_destroy(struct service_context *svc_ctx, struct tcb *tcb)
         * Close the connection, and then collecting the return value of thread
         */
        if (write(tcb->ctrl_pipe[PIPE_WRITE], &ch, sizeof(ch)) != sizeof(ch)) {
-               ErrPrint("write: %s\n", strerror(errno));
+               ErrPrint("write: %d\n", errno);
        }
 
        status = pthread_join(tcb->thid, &ret);
        if (status != 0) {
-               ErrPrint("Unable to join a thread: %s\n", strerror(status));
+               ErrPrint("Unable to join a thread: %d\n", status);
        } else {
                DbgPrint("Thread returns: %p\n", ret);
        }
@@ -627,7 +627,7 @@ static inline void processing_timer_event(struct service_context *svc_ctx, fd_se
                                        break;
                                }
                        } else {
-                               ErrPrint("read: %s\n", strerror(errno));
+                               ErrPrint("read: %d\n", errno);
                        }
 
                        if (!eina_list_data_find(svc_ctx->event_list, item)) {
@@ -636,7 +636,7 @@ static inline void processing_timer_event(struct service_context *svc_ctx, fd_se
 
                        svc_ctx->event_list = eina_list_remove(svc_ctx->event_list, item);
                        if (close(item->info.timer.fd) < 0) {
-                               ErrPrint("close: %s\n", strerror(errno));
+                               ErrPrint("close: %d\n", errno);
                        }
                        DbgFree(item);
                        break;
@@ -678,7 +678,7 @@ static void *server_main(void *data)
                                DbgPrint("INTERRUPTED\n");
                                continue;
                        }
-                       ErrPrint("Error: %s\n", strerror(errno));
+                       ErrPrint("select: %d\n", errno);
                        break;
                } else if (ret == 0) {
                        ErrPrint("Timeout\n");
@@ -703,7 +703,7 @@ static void *server_main(void *data)
 
                if (FD_ISSET(svc_ctx->evt_pipe[PIPE_READ], &set)) {
                        if (read(svc_ctx->evt_pipe[PIPE_READ], &evt_ch, sizeof(evt_ch)) != sizeof(evt_ch)) {
-                               ErrPrint("Unable to read pipe: %s\n", strerror(errno));
+                               ErrPrint("read: %d\n", errno);
                                ret = -EFAULT;
                                break;
                        }
@@ -744,7 +744,7 @@ static void *server_main(void *data)
                        Eina_List *n;
 
                        if (read(svc_ctx->tcb_pipe[PIPE_READ], &tcb, sizeof(tcb)) != sizeof(tcb)) {
-                               ErrPrint("Unable to read pipe: %s\n", strerror(errno));
+                               ErrPrint("read: %d\n", errno);
                                ret = -EFAULT;
                                break;
                        }
@@ -844,13 +844,13 @@ HAPI struct service_context *service_common_create(const char *addr, const char
                }
 
                if (unlink(addr + offset) < 0) {
-                       ErrPrint("[%s] - %s\n", addr, strerror(errno));
+                       ErrPrint("unlink [%s] - %d\n", addr, errno);
                }
        }
 
        svc_ctx = calloc(1, sizeof(*svc_ctx));
        if (!svc_ctx) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                return NULL;
        }
 
@@ -864,22 +864,22 @@ HAPI struct service_context *service_common_create(const char *addr, const char
        svc_ctx->service_thread_data = data;
 
        if (fcntl(svc_ctx->fd, F_SETFD, FD_CLOEXEC) < 0) {
-               ErrPrint("fcntl: %s\n", strerror(errno));
+               ErrPrint("fcntl: %d\n", errno);
        }
 
        if (fcntl(svc_ctx->fd, F_SETFL, O_NONBLOCK) < 0) {
-               ErrPrint("fcntl: %s\n", strerror(errno));
+               ErrPrint("fcntl: %d\n", errno);
        }
 
        if (pipe2(svc_ctx->evt_pipe, O_CLOEXEC) < 0) {
-               ErrPrint("pipe: %d\n", strerror(errno));
+               ErrPrint("pipe2: %d\n", errno);
                secure_socket_destroy_handle(svc_ctx->fd);
                DbgFree(svc_ctx);
                return NULL;
        }
 
        if (pipe2(svc_ctx->tcb_pipe, O_CLOEXEC) < 0) {
-               ErrPrint("pipe: %s\n", strerror(errno));
+               ErrPrint("pipe2: %d\n", errno);
                CLOSE_PIPE(svc_ctx->evt_pipe);
                secure_socket_destroy_handle(svc_ctx->fd);
                DbgFree(svc_ctx);
@@ -888,7 +888,7 @@ HAPI struct service_context *service_common_create(const char *addr, const char
 
        status = pthread_mutex_init(&svc_ctx->packet_list_lock, NULL);
        if (status != 0) {
-               ErrPrint("Unable to create a mutex: %s\n", strerror(status));
+               ErrPrint("Unable to create a mutex: %d\n", status);
                CLOSE_PIPE(svc_ctx->evt_pipe);
                CLOSE_PIPE(svc_ctx->tcb_pipe);
                secure_socket_destroy_handle(svc_ctx->fd);
@@ -899,10 +899,10 @@ HAPI struct service_context *service_common_create(const char *addr, const char
        DbgPrint("Creating server thread\n");
        status = pthread_create(&svc_ctx->server_thid, NULL, server_main, svc_ctx);
        if (status != 0) {
-               ErrPrint("Unable to create a thread for shortcut service: %s\n", strerror(status));
+               ErrPrint("Unable to create a thread for shortcut service: %d\n", status);
                status = pthread_mutex_destroy(&svc_ctx->packet_list_lock);
                if (status != 0) {
-                       ErrPrint("Error: %s\n", strerror(status));
+                       ErrPrint("mutex_destroy: %d\n", status);
                }
                CLOSE_PIPE(svc_ctx->evt_pipe);
                CLOSE_PIPE(svc_ctx->tcb_pipe);
@@ -938,12 +938,12 @@ HAPI int service_common_destroy(struct service_context *svc_ctx)
         * Terminate server thread
         */
        if (write(svc_ctx->tcb_pipe[PIPE_WRITE], &status, sizeof(status)) != sizeof(status)) {
-               ErrPrint("Failed to write: %s\n", strerror(errno));
+               ErrPrint("write: %d\n", errno);
        }
 
        status = pthread_join(svc_ctx->server_thid, &ret);
        if (status != 0) {
-               ErrPrint("Join: %s\n", strerror(status));
+               ErrPrint("Join: %d\n", status);
        } else {
                DbgPrint("Thread returns: %p\n", ret);
        }
@@ -952,7 +952,7 @@ HAPI int service_common_destroy(struct service_context *svc_ctx)
 
        status = pthread_mutex_destroy(&svc_ctx->packet_list_lock);
        if (status != 0) {
-               ErrPrint("Unable to destroy a mutex: %s\n", strerror(status));
+               ErrPrint("destroy_mutex: %d\n", status);
        }
 
        CLOSE_PIPE(svc_ctx->evt_pipe);
@@ -1114,21 +1114,21 @@ HAPI struct service_event_item *service_common_add_timer(struct service_context
 
        item = calloc(1, sizeof(*item));
        if (!item) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                return NULL;
        }
 
        item->type = SERVICE_EVENT_TIMER;
        item->info.timer.fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK | TFD_CLOEXEC);
        if (item->info.timer.fd < 0) {
-               ErrPrint("Error: %s\n", strerror(errno));
+               ErrPrint("timerfd_create: %d\n", errno);
                DbgFree(item);
                return NULL;
        }
 
        if (service_common_update_timer(item, timer) < 0) {
                if (close(item->info.timer.fd) < 0) {
-                       ErrPrint("close: %s\n", strerror(errno));
+                       ErrPrint("close: %d\n", errno);
                }
                DbgFree(item);
                return NULL;
@@ -1149,7 +1149,7 @@ HAPI int service_common_update_timer(struct service_event_item *item, double tim
        spec.it_interval.tv_nsec = (timer - spec.it_interval.tv_sec) * 1000000000;
 
        if (clock_gettime(CLOCK_MONOTONIC, &spec.it_value) < 0) {
-               ErrPrint("clock_gettime: %s\n", strerror(errno));
+               ErrPrint("clock_gettime: %d\n", errno);
                return -EFAULT;
        }
 
@@ -1157,7 +1157,7 @@ HAPI int service_common_update_timer(struct service_event_item *item, double tim
        spec.it_value.tv_nsec += spec.it_interval.tv_nsec;
 
        if (timerfd_settime(item->info.timer.fd, TFD_TIMER_ABSTIME, &spec, NULL) < 0) {
-               ErrPrint("Error: %s\n", strerror(errno));
+               ErrPrint("timerfd_settime: %d\n", errno);
                return -EFAULT;
        }
 
@@ -1179,7 +1179,7 @@ HAPI int service_common_del_timer(struct service_context *svc_ctx, struct servic
        svc_ctx->event_list = eina_list_remove(svc_ctx->event_list, item);
 
        if (close(item->info.timer.fd) < 0) {
-               ErrPrint("close: %s\n", strerror(errno));
+               ErrPrint("close: %d\n", errno);
        }
        DbgFree(item);
        return 0;
index 26c58f8..11dd052 100644 (file)
@@ -218,7 +218,7 @@ HAPI int setting_add_oom_event_callback(int (*handler)(enum oom_event_type type,
 
        item = malloc(sizeof(*item));
        if (!item) {
-               ErrPrint("malloc: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
index 2276794..fa675f2 100644 (file)
@@ -58,7 +58,7 @@ static inline int put_reply_context(struct tcb *tcb, double seq)
 
        ctx = malloc(sizeof(*ctx));
        if (!ctx) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                return -ENOMEM;
        }
 
index d02f253..40db882 100644 (file)
@@ -304,20 +304,20 @@ static inline struct slave_node *create_slave_node(const char *name, int is_secu
 
        slave = calloc(1, sizeof(*slave));
        if (!slave) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                return NULL;
        }
 
        slave->name = strdup(name);
        if (!slave->name) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                DbgFree(slave);
                return NULL;
        }
 
        slave->abi = strdup(abi);
        if (!slave->abi) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                DbgFree(slave->name);
                DbgFree(slave);
                return NULL;
@@ -325,7 +325,7 @@ static inline struct slave_node *create_slave_node(const char *name, int is_secu
 
        slave->pkgname = strdup(pkgname);
        if (!slave->pkgname) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                DbgFree(slave->abi);
                DbgFree(slave->name);
                DbgFree(slave);
@@ -335,7 +335,7 @@ static inline struct slave_node *create_slave_node(const char *name, int is_secu
        if (hw_acceleration) {
                slave->hw_acceleration = strdup(hw_acceleration);
                if (!slave->hw_acceleration) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("strdup: %d\n", errno);
                        DbgFree(slave->pkgname);
                        DbgFree(slave->abi);
                        DbgFree(slave->name);
@@ -901,7 +901,7 @@ HAPI int slave_activated(struct slave_node *slave)
        slave->activated_at = ecore_time_get();
 #else
        if (gettimeofday(&slave->activated_at, NULL) < 0) {
-               ErrPrint("Failed to get time of day: %s\n", strerror(errno));
+               ErrPrint("getimeofday: %d\n", errno);
                slave->activated_at.tv_sec = 0;
                slave->activated_at.tv_usec = 0;
        }
@@ -1118,7 +1118,7 @@ HAPI struct slave_node *slave_deactivated_by_fault(struct slave_node *slave)
                        slave->critical_fault_count = 0;
                }
        } else {
-               ErrPrint("Failed to get time of day: %s\n", strerror(errno));
+               ErrPrint("gettimeofday: %d\n", errno);
        }
 #endif
 
@@ -1160,7 +1160,7 @@ HAPI int slave_event_callback_add(struct slave_node *slave, enum slave_event eve
 
        ev = calloc(1, sizeof(*ev));
        if (!ev) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -1311,13 +1311,13 @@ HAPI int slave_set_data(struct slave_node *slave, const char *tag, void *data)
 
        priv = calloc(1, sizeof(*priv));
        if (!priv) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
        priv->tag = strdup(tag);
        if (!priv->tag) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("strdup: %d\n", errno);
                DbgFree(priv);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
@@ -1506,7 +1506,7 @@ HAPI char *slave_package_name(const char *abi, const char *lbid)
                DbgPrint("Failed to get replaced string\n");
                s_pkgname = strdup(tmp);
                if (!s_pkgname) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("strdup: %d\n", errno);
                        return NULL;
                }
        }
@@ -1951,7 +1951,7 @@ HAPI int slave_set_priority(struct slave_node *slave, int priority)
        }
 
        if (setpriority(PRIO_PROCESS, slave_pid(slave), priority) < 0) {
-               ErrPrint("setpriority: %s\n", strerror(errno));
+               ErrPrint("setpriority: %d\n", errno);
                return WIDGET_ERROR_FAULT;
        }
 
@@ -1975,7 +1975,7 @@ HAPI int slave_priority(struct slave_node *slave)
 
        priority = getpriority(PRIO_PROCESS, pid);
        if (priority < 0) {
-               ErrPrint("getpriority: %s\n", strerror(errno));
+               ErrPrint("getpriority: %d\n", errno);
                return WIDGET_ERROR_FAULT;
        }
 
index d608c40..3c0bd29 100644 (file)
@@ -82,14 +82,14 @@ static inline struct command *create_command(struct slave_node *slave, const cha
 
        command = calloc(1, sizeof(*command));
        if (!command) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                return NULL;
        }
 
        if (pkgname) {
                command->pkgname = strdup(pkgname);
                if (!command->pkgname) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("strdup: %d\n", errno);
                        DbgFree(command);
                        return NULL;
                }
@@ -550,7 +550,7 @@ HAPI int slave_rpc_init(struct slave_node *slave)
 
        rpc = calloc(1, sizeof(*rpc));
        if (!rpc) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
index 73c603b..2e5f557 100644 (file)
@@ -76,7 +76,7 @@ HAPI double util_timestamp(void)
        struct timeval tv;
        if (gettimeofday(&tv, NULL) < 0) {
                static unsigned long internal_count = 0;
-               ErrPrint("failed to get time of day: %s\n", strerror(errno));
+               ErrPrint("gettimeofday: %d\n", errno);
                tv.tv_sec = internal_count++;
                tv.tv_usec = 0;
        }
@@ -114,13 +114,13 @@ HAPI int util_unlink(const char *filename)
        desclen = strlen(filename) + 6; /* .desc */
        descfile = malloc(desclen);
        if (!descfile) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
        ret = snprintf(descfile, desclen, "%s.desc", filename);
        if (ret < 0) {
-               ErrPrint("Error: %s\n", strerror(errno));
+               ErrPrint("snprintf: %d\n", errno);
                DbgFree(descfile);
                return WIDGET_ERROR_FAULT;
        }
@@ -163,7 +163,7 @@ HAPI unsigned long long util_free_space(const char *path)
        unsigned long long space;
 
        if (statvfs(path, &st) < 0) {
-               ErrPrint("statvfs: %s\n", strerror(errno));
+               ErrPrint("statvfs: %d\n", errno);
                return 0lu;
        }
 
@@ -184,7 +184,7 @@ static inline char *extend_heap(char *buffer, int *sz, int incsz)
        *sz += incsz;
        tmp = realloc(buffer, *sz);
        if (!tmp) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("realloc: %d\n", errno);
                return NULL;
        }
 
@@ -205,7 +205,7 @@ HAPI double util_time_delay_for_compensation(double period)
        }
 
        if (gettimeofday(&tv, NULL) < 0){
-               ErrPrint("gettimeofday: %s\n", strerror(errno));
+               ErrPrint("gettimeofday: %d\n", errno);
                return period;
        }
 
@@ -258,7 +258,7 @@ HAPI int util_unlink_files(const char *folder)
        int len;
 
        if (lstat(folder, &info) < 0) {
-               ErrPrint("Error: %s\n", strerror(errno));
+               ErrPrint("lstat: %d\n", errno);
                return WIDGET_ERROR_IO_ERROR;
        }
 
@@ -269,7 +269,7 @@ HAPI int util_unlink_files(const char *folder)
 
        handle = opendir(folder);
        if (!handle) {
-               ErrPrint("Error: %s\n", strerror(errno));
+               ErrPrint("opendir: %d\n", errno);
                return WIDGET_ERROR_IO_ERROR;
        }
 
@@ -285,20 +285,20 @@ HAPI int util_unlink_files(const char *folder)
                len = strlen(folder) + strlen(entry->d_name) + 3;
                abspath = calloc(1, len);
                if (!abspath) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
+                       ErrPrint("calloc: %d\n", errno);
                        continue;
                }
                snprintf(abspath, len - 1, "%s/%s", folder, entry->d_name);
 
                if (unlink(abspath) < 0) {
-                       DbgPrint("unlink: %s\n", strerror(errno));
+                       DbgPrint("unlink: %d\n", errno);
                }
 
                DbgFree(abspath);
        }
 
        if (closedir(handle) < 0) {
-               ErrPrint("closedir: %s\n", strerror(errno));
+               ErrPrint("closedir: %d\n", errno);
        }
        return WIDGET_ERROR_NONE;
 }
@@ -308,7 +308,7 @@ HAPI void util_remove_emergency_disk(void)
        int ret;
        ret = umount(WIDGET_CONF_IMAGE_PATH);
        if (ret < 0) {
-               ErrPrint("umount: %s\n", strerror(errno));
+               ErrPrint("umount: %d\n", errno);
        }
 
        DbgPrint("Try to unmount[%s] %d\n", WIDGET_CONF_IMAGE_PATH, ret);
@@ -444,17 +444,17 @@ HAPI void util_prepare_emergency_disk(void)
        ret = mount(source, WIDGET_CONF_IMAGE_PATH, type, MS_NOSUID | MS_NOEXEC, option);
        DbgFree(buf);
        if (ret < 0) {
-               ErrPrint("Failed to mount: %s\n", strerror(errno));
+               ErrPrint("Failed to mount: %d\n", errno);
                return;
        }
 
        ErrPrint("Disk space is not enough, use the tmpfs. Currently required minimum space is %lu bytes\n", WIDGET_CONF_MINIMUM_SPACE);
        if (chmod(WIDGET_CONF_IMAGE_PATH, 0750) < 0) {
-               ErrPrint("chmod: %s\n", strerror(errno));
+               ErrPrint("chmod: %d\n", errno);
        }
 
        if (chown(WIDGET_CONF_IMAGE_PATH, 5000, 5000) < 0) {
-               ErrPrint("chown: %s\n", strerror(errno));
+               ErrPrint("chown: %d\n", errno);
        }
 
        ret = smack_setlabel(WIDGET_CONF_IMAGE_PATH, DATA_SHARE_LABEL, SMACK_LABEL_ACCESS);
@@ -466,14 +466,14 @@ HAPI void util_prepare_emergency_disk(void)
        }
 
        if (mkdir(WIDGET_CONF_ALWAYS_PATH, 0755) < 0) {
-               ErrPrint("mkdir: (%s) %s\n", WIDGET_CONF_ALWAYS_PATH, strerror(errno));
+               ErrPrint("mkdir: (%s) %d\n", WIDGET_CONF_ALWAYS_PATH, errno);
        } else {
                if (chmod(WIDGET_CONF_ALWAYS_PATH, 0750) < 0) {
-                       ErrPrint("chmod: %s\n", strerror(errno));
+                       ErrPrint("chmod: %d\n", errno);
                }
 
                if (chown(WIDGET_CONF_ALWAYS_PATH, 5000, 5000) < 0) {
-                       ErrPrint("chown: %s\n", strerror(errno));
+                       ErrPrint("chown: %d\n", errno);
                }
 
                ret = smack_setlabel(WIDGET_CONF_ALWAYS_PATH, DATA_SHARE_LABEL, SMACK_LABEL_ACCESS);
@@ -486,14 +486,14 @@ HAPI void util_prepare_emergency_disk(void)
        }
 
        if (mkdir(WIDGET_CONF_READER_PATH, 0755) < 0) {
-               ErrPrint("mkdir: (%s) %s\n", WIDGET_CONF_READER_PATH, strerror(errno));
+               ErrPrint("mkdir: (%s) %d\n", WIDGET_CONF_READER_PATH, errno);
        } else {
                if (chmod(WIDGET_CONF_READER_PATH, 0750) < 0) {
-                       ErrPrint("chmod: %s\n", strerror(errno));
+                       ErrPrint("chmod: %d\n", errno);
                }
 
                if (chown(WIDGET_CONF_READER_PATH, 5000, 5000) < 0) {
-                       ErrPrint("chown: %s\n", strerror(errno));
+                       ErrPrint("chown: %d\n", errno);
                }
 
                ret = smack_setlabel(WIDGET_CONF_READER_PATH, DATA_SHARE_LABEL, SMACK_LABEL_ACCESS);
@@ -524,14 +524,14 @@ HAPI void util_setup_log_disk(void)
 
        DbgPrint("Initiate the critical log folder [%s]\n", WIDGET_CONF_LOG_PATH);
        if (mkdir(WIDGET_CONF_LOG_PATH, 0755) < 0) {
-               ErrPrint("mkdir: %s\n", strerror(errno));
+               ErrPrint("mkdir: %d\n", errno);
        } else {
                if (chmod(WIDGET_CONF_LOG_PATH, 0750) < 0) {
-                       ErrPrint("chmod: %s\n", strerror(errno));
+                       ErrPrint("chmod: %d\n", errno);
                }
 
                if (chown(WIDGET_CONF_LOG_PATH, 5000, 5000) < 0) {
-                       ErrPrint("chown: %s\n", strerror(errno));
+                       ErrPrint("chown: %d\n", errno);
                }
 
                ret = smack_setlabel(WIDGET_CONF_LOG_PATH, DATA_SHARE_LABEL, SMACK_LABEL_ACCESS);
index 0b1fd97..69a49cd 100644 (file)
@@ -88,7 +88,7 @@ static int put_reply_tcb(struct tcb *tcb, double seq)
 
        ctx = malloc(sizeof(*ctx));
        if (!ctx) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -161,7 +161,7 @@ static inline int put_pended_request(struct tcb *tcb, struct packet *packet)
 
        item = malloc(sizeof(*item));
        if (!item) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
index bb84e19..bf815e9 100644 (file)
@@ -60,10 +60,10 @@ HAPI void widget_mgr_fini(void)
 
        EINA_LIST_FREE(s_info.info_list, info) {
                if (fclose(info->fp) != 0) {
-                       ErrPrint("fclose: %s\n", strerror(errno));
+                       ErrPrint("fclose: %d\n", errno);
                }
                if (unlink(info->fifo_name) < 0) {
-                       ErrPrint("unlink: %s\n", strerror(errno));
+                       ErrPrint("unlink: %d\n", errno);
                }
                DbgFree(info);
        }
@@ -80,12 +80,12 @@ static inline int valid_requestor(pid_t pid)
        DbgPrint("Open cmdline: %s (%d)\n", cmdline, pid);
 
        if (stat(cmdline, &target) < 0) {
-               ErrPrint("Error: %s\n", strerror(errno));
+               ErrPrint("Error: %d\n", errno);
                return 0;
        }
 
        if (stat("/opt/usr/devel/usr/bin/widget-mgr", &src) < 0) {
-               ErrPrint("Error: %s\n", strerror(errno));
+               ErrPrint("Error: %d\n", errno);
                return 0;
        }
 
@@ -113,15 +113,15 @@ HAPI struct widget_mgr *widget_mgr_create(pid_t pid, int handle)
 
        info = calloc(1, sizeof(*info));
        if (!info) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("calloc: %d\n", errno);
                return NULL;
        }
 
        snprintf(info->fifo_name, sizeof(info->fifo_name), "/tmp/.live_info.%lf", util_timestamp());
        if (mkfifo(info->fifo_name, 0644) < 0) {
-               ErrPrint("mkfifo: %s\n", strerror(errno));
+               ErrPrint("mkfifo: %d\n", errno);
                if (unlink(info->fifo_name) < 0) {
-                       ErrPrint("unlink: %s\n", strerror(errno));
+                       ErrPrint("unlink: %d\n", errno);
                }
                DbgFree(info);
                return NULL;
@@ -141,7 +141,7 @@ HAPI int widget_mgr_open_fifo(struct widget_mgr *info)
        DbgPrint("FIFO is created (%s)\n", info->fifo_name);
        info->fp = fopen(info->fifo_name, "w");
        if (!info->fp) {
-               ErrPrint("open: %s\n", strerror(errno));
+               ErrPrint("open: %d\n", errno);
                return WIDGET_ERROR_IO_ERROR;
        }
 
@@ -152,7 +152,7 @@ HAPI void widget_mgr_close_fifo(struct widget_mgr *info)
 {
        if (info->fp) {
                if (fclose(info->fp) != 0) {
-                       ErrPrint("fclose: %s\n", strerror(errno));
+                       ErrPrint("fclose: %d\n", errno);
                }
                info->fp = NULL;
        }
@@ -163,7 +163,7 @@ HAPI void widget_mgr_destroy(struct widget_mgr *info)
        s_info.info_list = eina_list_remove(s_info.info_list, info);
        widget_mgr_close_fifo(info);
        if (unlink(info->fifo_name) < 0) {
-               ErrPrint("unlink: %s\n", strerror(errno));
+               ErrPrint("unlink: %d\n", errno);
        }
        DbgFree(info);
 }
index 17a329b..e270157 100644 (file)
@@ -76,17 +76,17 @@ static inline void touch_paused_file(void)
        fd = creat(WIDGET_CONF_PAUSED_FILE, 0644);
        if (fd >= 0) {
                if (close(fd) < 0) {
-                       ErrPrint("close: %s\n", strerror(errno));
+                       ErrPrint("close: %d\n", errno);
                }
        } else {
-               ErrPrint("Create .live.paused: %s\n", strerror(errno));
+               ErrPrint("Create .live.paused: %d\n", errno);
        }
 }
 
 static inline void remove_paused_file(void)
 {
        if (unlink(WIDGET_CONF_PAUSED_FILE) < 0) {
-               ErrPrint("Unlink .live.paused: %s\n", strerror(errno));
+               ErrPrint("Unlink .live.paused: %d\n", errno);
        }
 }
 
@@ -262,7 +262,7 @@ static inline void sniff_all_windows(void)
 
        new_item = malloc(sizeof(*new_item));
        if (!new_item) {
-               ErrPrint("Error(%s)\n", strerror(errno));
+               ErrPrint("Error(%d)\n", errno);
                return;
        }
 
@@ -299,7 +299,7 @@ static inline void sniff_all_windows(void)
 
                        new_item = malloc(sizeof(*new_item));
                        if (!new_item) {
-                               ErrPrint("Error %s\n", strerror(errno));
+                               ErrPrint("Error %d\n", errno);
                                item->i++;
                                continue;
                        }
@@ -426,7 +426,7 @@ HAPI int xmonitor_add_event_callback(enum xmonitor_event event, int (*cb)(void *
 
        item = malloc(sizeof(*item));
        if (!item) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("Heap: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
index cd208f7..76bf86c 100644 (file)
@@ -72,17 +72,17 @@ static inline void touch_paused_file(void)
        fd = creat(WIDGET_CONF_PAUSED_FILE, 0644);
        if (fd >= 0) {
                if (close(fd) < 0) {
-                       ErrPrint("close: %s\n", strerror(errno));
+                       ErrPrint("close: %d\n", errno);
                }
        } else {
-               ErrPrint("Create .live.paused: %s\n", strerror(errno));
+               ErrPrint("Create .live.paused: %d\n", errno);
        }
 }
 
 static inline void remove_paused_file(void)
 {
        if (unlink(WIDGET_CONF_PAUSED_FILE) < 0) {
-               ErrPrint("Unlink .live.paused: %s\n", strerror(errno));
+               ErrPrint("Unlink .live.paused: %d\n", errno);
        }
 }
 
@@ -185,7 +185,7 @@ HAPI int xmonitor_add_event_callback(enum xmonitor_event event, int (*cb)(void *
 
        item = malloc(sizeof(*item));
        if (!item) {
-               ErrPrint("Heap: %s\n", strerror(errno));
+               ErrPrint("malloc: %d\n", errno);
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
index 1b5c482..45c1dc7 100644 (file)
@@ -162,7 +162,7 @@ struct node *node_find(const struct node *node, const char *path)
 
        buffer = malloc(strlen(path) + 3); /* add 2 more bytes */
        if (!buffer) {
-               printf("Error: %s\n", strerror(errno));
+               printf("malloc: %d\n", errno);
                return NULL;
        }
 
@@ -212,7 +212,7 @@ struct node *node_create(struct node *parent, const char *name, enum node_type t
 
        node = malloc(sizeof(*node));
        if (!node) {
-               printf("Error: %s\n", strerror(errno));
+               printf("malloc: %d\n", errno);
                return NULL;
        }
 
@@ -221,7 +221,7 @@ struct node *node_create(struct node *parent, const char *name, enum node_type t
        if (name) {
                node->name = strdup(name);
                if (!node->name) {
-                       printf("Error: %s\n", strerror(errno));
+                       printf("strdup: %d\n", errno);
                        free(node);
                        return NULL;
                }
index fa765b0..ad06a2e 100644 (file)
@@ -377,7 +377,7 @@ static int pkglist_cb(const char *appid, const char *lbid, int is_prime, void *d
                free(info->pkgid);
                info->pkgid = strdup(appid);
                if (!info->pkgid) {
-                       printf("Error: %s\n", strerror(errno));
+                       printf("strdup: %d\n", errno);
                        return -ENOMEM;
                }
 
@@ -387,13 +387,13 @@ static int pkglist_cb(const char *appid, const char *lbid, int is_prime, void *d
 
        info = calloc(1, sizeof(*info));
        if (!info) {
-               printf("Error: %s\n", strerror(errno));
+               printf("calloc: %d\n", errno);
                return -ENOMEM;
        }
 
        info->pkgid = strdup(appid);
        if (!info->pkgid) {
-               printf("Error: %s\n", strerror(errno));
+               printf("strdup: %d\n", errno);
                free(info);
                return -ENOMEM;
        }
@@ -975,16 +975,16 @@ static void do_sh(const char *cmd)
                command[idx] = '\0';
 
                if (execl(command, cmd, NULL) < 0) {
-                       printf("Failed to execute: %s\n", strerror(errno));
+                       printf("execl: %d\n", errno);
                }
 
                exit(0);
        } else if (pid < 0) {
-               printf("Failed to create a new process: %s\n", strerror(errno));
+               printf("Failed to create a new process: %d\n", errno);
        } else {
                int status;
                if (waitpid(pid, &status, 0) < 0) {
-                       printf("error: %s\n", strerror(errno));
+                       printf("waitpid: %d\n", errno);
                } else {
                        if (WIFEXITED(status)) {
                                printf("Exit: %d\n", WEXITSTATUS(status));
@@ -1045,7 +1045,7 @@ static inline int do_capture(Display *disp, Pixmap id, const char *filename)
 
        si.shmid = shmget(IPC_PRIVATE, bufsz, IPC_CREAT | 0666);
        if (si.shmid < 0) {
-               printf("shmget: %s\n", strerror(errno));
+               printf("shmget: %d\n", errno);
                return -EFAULT;
        }
 
@@ -1054,7 +1054,7 @@ static inline int do_capture(Display *disp, Pixmap id, const char *filename)
        if (si.shmaddr == (void *)-1) {
 
                if (shmctl(si.shmid, IPC_RMID, 0) < 0) {
-                       printf("shmctl: %s\n", strerror(errno));
+                       printf("shmctl: %d\n", errno);
                }
 
                return -EFAULT;
@@ -1067,11 +1067,11 @@ static inline int do_capture(Display *disp, Pixmap id, const char *filename)
        xim = XShmCreateImage(disp, visual, 24 /* (depth << 3) */, ZPixmap, NULL, &si, w, h);
        if (xim == NULL) {
                if (shmdt(si.shmaddr) < 0) {
-                       printf("shmdt: %s\n", strerror(errno));
+                       printf("shmdt: %d\n", errno);
                }
 
                if (shmctl(si.shmid, IPC_RMID, 0) < 0) {
-                       printf("shmctl: %s\n", strerror(errno));
+                       printf("shmctl: %d\n", errno);
                }
 
                return -EFAULT;
@@ -1090,21 +1090,21 @@ static inline int do_capture(Display *disp, Pixmap id, const char *filename)
                }
 
                if (close(fd) < 0) {
-                       printf("close: %s\n", strerror(errno));
+                       printf("close: %d\n", errno);
                }
        } else {
-               printf("Error: %sn\n", strerror(errno));
+               printf("Error: %d\n", errno);
        }
 
        XShmDetach(disp, &si);
        XDestroyImage(xim);
 
        if (shmdt(si.shmaddr) < 0) {
-               printf("shmdt: %s\n", strerror(errno));
+               printf("shmdt: %d\n", errno);
        }
 
        if (shmctl(si.shmid, IPC_RMID, 0) < 0) {
-               printf("shmctl: %s\n", strerror(errno));
+               printf("shmctl: %d\n", errno);
        }
 
        return 0;
@@ -1580,13 +1580,13 @@ static void processing_line_buffer(const char *buffer)
                if (!node) {
                        pkginfo = calloc(1, sizeof(*pkginfo));
                        if (!pkginfo) {
-                               printf("Error: %s\n", strerror(errno));
+                               printf("calloc: %d\n", errno);
                                return;
                        }
 
                        pkginfo->pkgid = strdup("conf.file");
                        if (!pkginfo->pkgid) {
-                               printf("Error: %s\n", strerror(errno));
+                               printf("strdup: %d\n", errno);
                        }
 
                        pkginfo->primary = 1;
@@ -1618,12 +1618,12 @@ static void processing_line_buffer(const char *buffer)
 
                pkginfo->slavename = strdup(slavename);
                if (!pkginfo->slavename) {
-                       printf("Error: %s\n", strerror(errno));
+                       printf("strdup: %d\n", errno);
                }
 
                pkginfo->abi = strdup(abi);
                if (!pkginfo->abi) {
-                       printf("Error: %s\n", strerror(errno));
+                       printf("strdup: %d\n", errno);
                }
 
                pkginfo->pid = pid;
@@ -1640,7 +1640,7 @@ static void processing_line_buffer(const char *buffer)
                if (!node) {
                        slaveinfo = calloc(1, sizeof(*slaveinfo));
                        if (!slaveinfo) {
-                               printf("Error: %s\n", strerror(errno));
+                               printf("Error: %d\n", errno);
                                return;
                        }
 
@@ -1663,17 +1663,17 @@ static void processing_line_buffer(const char *buffer)
 
                slaveinfo->pkgname = strdup(pkgname);
                if (!slaveinfo->pkgname) {
-                       printf("Error: %s\n", strerror(errno));
+                       printf("strdup: %d\n", errno);
                }
 
                slaveinfo->abi = strdup(abi);
                if (!slaveinfo->abi) {
-                       printf("Error: %s\n", strerror(errno));
+                       printf("strdup: %d\n", errno);
                }
 
                slaveinfo->state = strdup(state);
                if (!slaveinfo->state) {
-                       printf("Error: %s\n", strerror(errno));
+                       printf("strdup: %d\n", errno);
                }
 
                slaveinfo->pid = pid;
@@ -1703,7 +1703,7 @@ static void processing_line_buffer(const char *buffer)
                if (!node) {
                        instinfo = calloc(1, sizeof(*instinfo));
                        if (!instinfo) {
-                               printf("Error: %s\n", strerror(errno));
+                               printf("calloc: %d\n", errno);
                                return;
                        }
 
@@ -1733,22 +1733,22 @@ static void processing_line_buffer(const char *buffer)
 
                instinfo->id = strdup(inst_id);
                if (!instinfo->id) {
-                       printf("Error: %s\n", strerror(errno));
+                       printf("strdup: %d\n", errno);
                }
 
                instinfo->cluster = strdup(cluster);
                if (!instinfo->cluster) {
-                       printf("Error: %s\n", strerror(errno));
+                       printf("strdup: %d\n", errno);
                }
 
                instinfo->category = strdup(category);
                if (!instinfo->category) {
-                       printf("Error: %s\n", strerror(errno));
+                       printf("strdup: %d\n", errno);
                }
 
                instinfo->state = strdup(state);
                if (!instinfo->state) {
-                       printf("Error: %s\n", strerror(errno));
+                       printf("strdup: %d\n", errno);
                }
 
                if (strlen(buf_id)) {
@@ -1761,7 +1761,7 @@ static void processing_line_buffer(const char *buffer)
                break;
        case INST_CTRL:
                sscanf(buffer, "%d", &i);
-               printf("%s\n", strerror(i));
+               printf("%d\n", i);
                printf("Result: %d\n", i);
                break;
        case SLAVE_CTRL:
@@ -1816,7 +1816,7 @@ static Eina_Bool read_cb(void *data, Ecore_Fd_Handler *fd_handler)
        }
 
        if (read(fd, &ch, sizeof(ch)) != sizeof(ch)) {
-               printf("Error: %s\n", strerror(errno));
+               printf("read: %d\n", errno);
                return ECORE_CALLBACK_CANCEL;
        }
 
@@ -1824,7 +1824,7 @@ static Eina_Bool read_cb(void *data, Ecore_Fd_Handler *fd_handler)
                line_index = 0;
                line_buffer = malloc(bufsz);
                if (!line_buffer) {
-                       printf("Error: %s\n", strerror(errno));
+                       printf("malloc: %d\n", errno);
                        return ECORE_CALLBACK_CANCEL;
                }
        }       
@@ -1834,7 +1834,7 @@ static Eina_Bool read_cb(void *data, Ecore_Fd_Handler *fd_handler)
                        char *new_buf;
                        new_buf = realloc(line_buffer, bufsz + 2);
                        if (!new_buf) {
-                               printf("Error: %s\n", strerror(errno));
+                               printf("realloc: %d\n", errno);
                                free(line_buffer);
                                line_buffer = NULL;
                                line_index = 0;
@@ -1866,7 +1866,7 @@ static Eina_Bool read_cb(void *data, Ecore_Fd_Handler *fd_handler)
                        bufsz += 256;
                        new_buf = realloc(line_buffer, bufsz);
                        if (!new_buf) {
-                               printf("Error: %s\n", strerror(errno));
+                               printf("realloc: %d\n", errno);
                                free(line_buffer);
                                line_buffer = NULL;
                                line_index = 0;
@@ -1900,7 +1900,7 @@ static int ret_cb(pid_t pid, int handle, const struct packet *packet, void *data
 
        s_info.fifo_handle = open(fifo_name, O_RDONLY | O_NONBLOCK);
        if (s_info.fifo_handle < 0) {
-               printf("Error: %s\n", strerror(errno));
+               printf("open: %d\n", errno);
                s_info.fifo_handle = -EINVAL;
                ecore_main_loop_quit();
                return -EINVAL;
@@ -1910,7 +1910,7 @@ static int ret_cb(pid_t pid, int handle, const struct packet *packet, void *data
        if (!s_info.fd_handler) {
                printf("Failed to add a fd handler\n");
                if (close(s_info.fifo_handle) < 0) {
-                       printf("close: %s\n", strerror(errno));
+                       printf("close: %d\n", errno);
                }
                s_info.fifo_handle = -EINVAL;
                ecore_main_loop_quit();
@@ -1921,7 +1921,7 @@ static int ret_cb(pid_t pid, int handle, const struct packet *packet, void *data
 
        if (s_info.input_fd == STDIN_FILENO) {
                if (fcntl(s_info.input_fd, F_SETFL, O_NONBLOCK) < 0) {
-                       printf("Error: %s\n", strerror(errno));
+                       printf("fcntl: %d\n", errno);
                }
 
                s_info.in_handler = ecore_main_fd_handler_add(s_info.input_fd, ECORE_FD_READ, input_cb, NULL, NULL, NULL);
@@ -2002,13 +2002,13 @@ int main(int argc, char *argv[])
                        if (s_info.input_fd != STDIN_FILENO) {
                                /* Close the previously, opened file */
                                if (close(s_info.input_fd) < 0) {
-                                       printf("close: %s\n", strerror(errno));
+                                       printf("close: %d\n", errno);
                                }
                        }
 
                        s_info.input_fd = open(optarg, O_RDONLY);
                        if (s_info.input_fd < 0) {
-                               printf("Unable to access %s (%s)\n", optarg, strerror(errno));
+                               printf("Unable to access %s (%d)\n", optarg, errno);
                                return -EIO;
                        }
                        break;
@@ -2064,13 +2064,13 @@ int main(int argc, char *argv[])
                printf("Type your command on below empty line\n");
 
                if (tcgetattr(s_info.input_fd, &ttystate) < 0) {
-                       printf("Error: %s\n", strerror(errno));
+                       printf("Error: %d\n", errno);
                } else {
                        ttystate.c_lflag &= ~(ICANON | ECHO);
                        ttystate.c_cc[VMIN] = 1;
 
                        if (tcsetattr(s_info.input_fd, TCSANOW, &ttystate) < 0) {
-                               printf("Error: %s\n", strerror(errno));
+                               printf("Error: %d\n", errno);
                        }
                }
        } else {
@@ -2078,7 +2078,7 @@ int main(int argc, char *argv[])
        }
 
        if (setvbuf(stdout, (char *)NULL, _IONBF, 0) != 0) {
-               printf("Error: %s\n", strerror(errno));
+               printf("setvbuf: %d\n", errno);
        }
 
        init_directory();
@@ -2101,17 +2101,17 @@ int main(int argc, char *argv[])
        if (s_info.input_fd == STDIN_FILENO) {
                ttystate.c_lflag |= ICANON | ECHO;
                if (tcsetattr(s_info.input_fd, TCSANOW, &ttystate) < 0) {
-                       printf("Error: %s\n", strerror(errno));
+                       printf("tcsetattr: %d\n", errno);
                }
        } else {
                if (close(s_info.input_fd) < 0) {
-                       printf("close: %s\n", strerror(errno));
+                       printf("close: %d\n", errno);
                }
        }
 
        if (s_info.fifo_handle > 0) {
                if (close(s_info.fifo_handle) < 0) {
-                       printf("close: %s\n", strerror(errno));
+                       printf("close: %d\n", errno);
                }
                s_info.fifo_handle = -EINVAL;
        }