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
#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); \
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) \
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
}
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;
i18n = calloc(1, sizeof(*i18n));
if (!i18n) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("calloc: %d\n", errno);
xmlFree(name);
xmlFree(lang);
return;
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);
i18n = calloc(1, sizeof(*i18n));
if (!i18n) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("calloc: %d\n", errno);
xmlFree(icon);
xmlFree(lang);
return;
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);
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]);
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);
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;
option = calloc(1, sizeof(*option));
if (!option) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("calloc: %d\n", errno);
xmlFree(key);
xmlFree(value);
continue;
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);
widget = calloc(1, sizeof(*widget));
if (!widget) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("calloc: %d\n", errno);
xmlFree(pkgid);
return -ENOMEM;
}
} 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;
}
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;
}
widget = calloc(1, sizeof(*widget));
if (!widget) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
xmlFree(pkgid);
return -ENOMEM;
}
buffer = calloc(1, sizeof(*buffer) + sizeof(*gem));
if (!buffer) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("calloc: %d\n", errno);
return NULL;
}
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;
}
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;
}
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;
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;
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;
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;
}
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);
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;
}
}
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;
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;
}
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;
}
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;
}
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;
}
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;
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;
} 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");
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;
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;
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;
{
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;
}
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;
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;
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;
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;
}
ret = shmdt(buffer);
if (ret < 0) {
- ErrPrint("shmdt: %s\n", strerror(errno));
+ ErrPrint("shmdt: %d\n", errno);
}
return ret;
buffer = calloc(1, sizeof(*buffer) + WIDGET_CONF_DEFAULT_PIXELS);
if (!buffer) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("calloc: %d\n", errno);
return NULL;
}
info = malloc(sizeof(*info));
if (!info) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("malloc: %d\n", errno);
return NULL;
}
info->id = strdup(SCHEMA_SHM "-1");
if (!info->id) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
DbgFree(info);
return NULL;
}
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;
}
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;
}
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;
}
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;
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;
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;
}
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);
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;
}
}
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;
} 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");
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;
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;
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;
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;
}
ret = shmdt(buffer);
if (ret < 0) {
- ErrPrint("shmdt: %s\n", strerror(errno));
+ ErrPrint("shmdt: %d\n", errno);
}
return ret;
info = malloc(sizeof(*info));
if (!info) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("malloc: %d\n", errno);
return NULL;
}
info->id = strdup(SCHEMA_SHM "-1");
if (!info->id) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
DbgFree(info);
return NULL;
}
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;
}
client = calloc(1, sizeof(*client));
if (!client) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("calloc: %d\n", errno);
return NULL;
}
item = malloc(sizeof(*item));
if (!item) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("malloc: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
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;
}
handler = malloc(sizeof(*handler));
if (!handler) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("malloc: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
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;
}
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;
command = calloc(1, sizeof(*command));
if (!command) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("calloc: %d\n", errno);
return NULL;
}
rpc = calloc(1, sizeof(*rpc));
if (!rpc) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("calloc: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
if (s_info.fp) {
if (fclose(s_info.fp) != 0) {
- ErrPrint("fclose: %s\n", strerror(errno));
+ ErrPrint("fclose: %d\n", errno);
}
}
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);
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;
}
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;
}
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;
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;
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);
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");
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;
}
* 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;
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;
}
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;
}
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;
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);
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;
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;
/* 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);
}
listener = malloc(sizeof(*listener));
if (!listener) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("malloc: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
}
if (unlink(filename) < 0) {
- ErrPrint("unlink: %s\n", strerror(errno));
+ ErrPrint("unlink: %d\n", errno);
}
}
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) {
item = malloc(sizeof(*item));
if (!item) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("malloc: %d\n", errno);
return NULL;
}
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;
}
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);
/* 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;
}
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;
}
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;
}
body = malloc(PKT_CHUNKSZ + sizeof(*body));
if (!body) {
- ErrPrint("heap: %s\n", strerror(errno));
+ ErrPrint("malloc: %d\n", errno);
goto errout;
}
ret = read(fd, body->data, body->size);
if (ret < 0) {
- ErrPrint("read: %s\n", strerror(errno));
+ ErrPrint("read: %d\n", errno);
ret = -EIO;
break;
}
errout:
if (close(fd) < 0) {
- ErrPrint("close: %s\n", strerror(errno));
+ ErrPrint("close: %d\n", errno);
}
return ret;
head = malloc(pktsz);
if (!head) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("malloc: %d\n", errno);
(void)buffer_handler_raw_close(buffer);
return -ENOMEM;
}
ret = 0;
continue;
}
- ErrPrint("Error: %s\n", strerror(errno));
+ ErrPrint("select: %d\n", errno);
break;
} else if (ret == 0) {
ErrPrint("Timeout\n");
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;
}
}
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;
}
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);
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);
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);
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);
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;
}
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;
}
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;
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;
}
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;
}
name = malloc(_len + 1);
if (!name) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("malloc: %d\n", errno);
return NULL;
}
#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;
}
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;
}
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;
}
inst = calloc(1, sizeof(*inst));
if (!inst) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("calloc: %d\n", errno);
return NULL;
}
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;
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);
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);
inst = calloc(1, sizeof(*inst));
if (!inst) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("calloc: %d\n", errno);
return NULL;
}
tmp = strdup(content);
if (!tmp) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
goto out;
}
tmp = strdup(title);
if (!tmp) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
goto out;
}
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);
}
}
cbdata = malloc(sizeof(*cbdata));
if (!cbdata) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("malloc: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
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);
}
}
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);
}
}
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
cbdata = malloc(sizeof(*cbdata));
if (!cbdata) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("malloc: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
cbdata = malloc(sizeof(*cbdata));
if (!cbdata) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("malloc: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
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;
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;
}
if (tmp && strlen(tmp)) {
pkgid = strdup(tmp);
if (!pkgid) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
}
}
dir = opendir(WIDGET_CONF_ROOT_PATH);
if (!dir) {
- ErrPrint("Error: %s\n", strerror(errno));
+ ErrPrint("opendir: %d\n", errno);
} else {
struct dirent *ent;
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);
}
}
}
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;
}
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);
}
}
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;
}
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);
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);
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;
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;
}
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;
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);
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);
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);
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);
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) {
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;
}
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;
if (!widget_id) {
widget_id = strdup(pkgname);
if (!widget_id) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
return NULL;
}
}
fault = calloc(1, sizeof(*fault));
if (!fault) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("calloc: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
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;
tmp = strdup(script);
if (!tmp) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
char *tmp;
tmp = strdup(abi);
if (!tmp) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
tmp = strdup(path);
if (!tmp) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
tmp = strdup(group);
if (!tmp) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
tmp = strdup(path);
if (!tmp) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
tmp = strdup(group);
if (!tmp) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
info->widget.auto_launch = strdup(auto_launch);
if (!info->widget.auto_launch) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
return;
}
}
tmp = strdup(libexec);
if (!tmp) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
tmp = strdup(hw_acceleration);
if (!tmp) {
- ErrPrint("strdup: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
tmp = strdup(category);
if (!tmp) {
- ErrPrint("strdup: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
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);
ret = strdup(buffer);
if (!ret) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
return NULL;
}
item->auto_launch = strdup(buffer);
if (!item->auto_launch) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
return;
}
}
item->widget_path = dup_rtrim(buffer);
if (!item->widget_path) {
- ErrPrint("Error: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
}
}
item->group = dup_rtrim(buffer);
if (!item->group) {
- ErrPrint("Error: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
}
}
item->widget_group = dup_rtrim(buffer);
if (!item->widget_group) {
- ErrPrint("Error: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
}
}
item->gbar_path = dup_rtrim(buffer);
if (!item->gbar_path) {
- ErrPrint("Error: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
}
}
item->gbar_group = dup_rtrim(buffer);
if (!item->gbar_group) {
- ErrPrint("Error: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
}
}
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;
} 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);
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;
}
item->icon = strdup(val);
if (!item->icon) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
new_pkgname = strdup(val);
if (!new_pkgname) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
item = calloc(1, sizeof(*item));
if (!item) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("calloc: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
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;
}
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;
}
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;
}
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;
}
}
if (closedir(dir) < 0) {
- ErrPrint("closedir: %s\n", strerror(errno));
+ ErrPrint("closedir: %d\n", errno);
}
return WIDGET_ERROR_NONE;
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;
}
info = calloc(1, sizeof(*info));
if (!info) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("calloc: %d\n", errno);
return NULL;
}
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);
}
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;
}
continue;
}
- ErrPrint("read: %s\n", strerror(errno));
+ ErrPrint("read: %d\n", errno);
free(filebuf);
filebuf = NULL;
break;
errout:
if (close(fd) < 0) {
- ErrPrint("close: %s\n", strerror(errno));
+ ErrPrint("close: %d\n", errno);
}
return filebuf;
if (*fileptr == '{') {
block = calloc(1, sizeof(*block));
if (!block) {
- ErrPrint("calloc: %s\n", strerror(errno));
+ ErrPrint("calloc: %d\n", errno);
state = ERROR;
continue;
}
}
}
} 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);
}
item = malloc(sizeof(*item));
if (!item) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("malloc: %d\n", errno);
ret = WIDGET_ERROR_OUT_OF_MEMORY;
} else {
/*!
}
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:
} else {
ctx = calloc(1, sizeof(*ctx));
if (!ctx) {
- ErrPrint("calloc: %s\n", strerror(errno));
+ ErrPrint("calloc: %d\n", errno);
goto out;
}
ctx->pkgname = strdup(pkgname);
if (!ctx->pkgname) {
- ErrPrint("strdup: %s\n", strerror(errno));
+ ErrPrint("strdup: %d\n", errno);
DbgFree(ctx);
goto out;
}
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;
}
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);
}
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;
ret = 0;
continue;
}
- ErrPrint("Error: %s\n", strerror(errno));
+ ErrPrint("select: %d\n", errno);
DbgFree(ptr);
ptr = NULL;
break;
packet = NULL;
ptr = malloc(size);
if (!ptr) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("malloc: %d\n", errno);
ret = -ENOMEM;
break;
}
ptr = malloc(size);
if (!ptr) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("malloc: %d\n", errno);
ret = -ENOMEM;
}
}
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;
}
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);
* 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;
cbdata = malloc(sizeof(*cbdata));
if (!cbdata) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("malloc: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
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;
}
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;
* 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);
}
* 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);
}
break;
}
} else {
- ErrPrint("read: %s\n", strerror(errno));
+ ErrPrint("read: %d\n", errno);
}
if (!eina_list_data_find(svc_ctx->event_list, item)) {
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;
DbgPrint("INTERRUPTED\n");
continue;
}
- ErrPrint("Error: %s\n", strerror(errno));
+ ErrPrint("select: %d\n", errno);
break;
} else if (ret == 0) {
ErrPrint("Timeout\n");
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;
}
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;
}
}
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;
}
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);
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);
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);
* 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);
}
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);
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;
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;
}
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;
}
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;
item = malloc(sizeof(*item));
if (!item) {
- ErrPrint("malloc: %s\n", strerror(errno));
+ ErrPrint("malloc: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
ctx = malloc(sizeof(*ctx));
if (!ctx) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("malloc: %d\n", errno);
return -ENOMEM;
}
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;
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);
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);
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;
}
slave->critical_fault_count = 0;
}
} else {
- ErrPrint("Failed to get time of day: %s\n", strerror(errno));
+ ErrPrint("gettimeofday: %d\n", errno);
}
#endif
ev = calloc(1, sizeof(*ev));
if (!ev) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("calloc: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
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;
}
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;
}
}
}
if (setpriority(PRIO_PROCESS, slave_pid(slave), priority) < 0) {
- ErrPrint("setpriority: %s\n", strerror(errno));
+ ErrPrint("setpriority: %d\n", errno);
return WIDGET_ERROR_FAULT;
}
priority = getpriority(PRIO_PROCESS, pid);
if (priority < 0) {
- ErrPrint("getpriority: %s\n", strerror(errno));
+ ErrPrint("getpriority: %d\n", errno);
return WIDGET_ERROR_FAULT;
}
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;
}
rpc = calloc(1, sizeof(*rpc));
if (!rpc) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("calloc: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
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;
}
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;
}
unsigned long long space;
if (statvfs(path, &st) < 0) {
- ErrPrint("statvfs: %s\n", strerror(errno));
+ ErrPrint("statvfs: %d\n", errno);
return 0lu;
}
*sz += incsz;
tmp = realloc(buffer, *sz);
if (!tmp) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("realloc: %d\n", errno);
return NULL;
}
}
if (gettimeofday(&tv, NULL) < 0){
- ErrPrint("gettimeofday: %s\n", strerror(errno));
+ ErrPrint("gettimeofday: %d\n", errno);
return period;
}
int len;
if (lstat(folder, &info) < 0) {
- ErrPrint("Error: %s\n", strerror(errno));
+ ErrPrint("lstat: %d\n", errno);
return WIDGET_ERROR_IO_ERROR;
}
handle = opendir(folder);
if (!handle) {
- ErrPrint("Error: %s\n", strerror(errno));
+ ErrPrint("opendir: %d\n", errno);
return WIDGET_ERROR_IO_ERROR;
}
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;
}
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);
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);
}
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);
}
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);
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);
ctx = malloc(sizeof(*ctx));
if (!ctx) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("malloc: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
item = malloc(sizeof(*item));
if (!item) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("malloc: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
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);
}
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;
}
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;
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;
}
{
if (info->fp) {
if (fclose(info->fp) != 0) {
- ErrPrint("fclose: %s\n", strerror(errno));
+ ErrPrint("fclose: %d\n", errno);
}
info->fp = NULL;
}
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);
}
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);
}
}
new_item = malloc(sizeof(*new_item));
if (!new_item) {
- ErrPrint("Error(%s)\n", strerror(errno));
+ ErrPrint("Error(%d)\n", errno);
return;
}
new_item = malloc(sizeof(*new_item));
if (!new_item) {
- ErrPrint("Error %s\n", strerror(errno));
+ ErrPrint("Error %d\n", errno);
item->i++;
continue;
}
item = malloc(sizeof(*item));
if (!item) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("Heap: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
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);
}
}
item = malloc(sizeof(*item));
if (!item) {
- ErrPrint("Heap: %s\n", strerror(errno));
+ ErrPrint("malloc: %d\n", errno);
return WIDGET_ERROR_OUT_OF_MEMORY;
}
buffer = malloc(strlen(path) + 3); /* add 2 more bytes */
if (!buffer) {
- printf("Error: %s\n", strerror(errno));
+ printf("malloc: %d\n", errno);
return NULL;
}
node = malloc(sizeof(*node));
if (!node) {
- printf("Error: %s\n", strerror(errno));
+ printf("malloc: %d\n", errno);
return NULL;
}
if (name) {
node->name = strdup(name);
if (!node->name) {
- printf("Error: %s\n", strerror(errno));
+ printf("strdup: %d\n", errno);
free(node);
return NULL;
}
free(info->pkgid);
info->pkgid = strdup(appid);
if (!info->pkgid) {
- printf("Error: %s\n", strerror(errno));
+ printf("strdup: %d\n", errno);
return -ENOMEM;
}
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;
}
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));
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;
}
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;
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;
}
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;
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;
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;
if (!node) {
slaveinfo = calloc(1, sizeof(*slaveinfo));
if (!slaveinfo) {
- printf("Error: %s\n", strerror(errno));
+ printf("Error: %d\n", errno);
return;
}
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;
if (!node) {
instinfo = calloc(1, sizeof(*instinfo));
if (!instinfo) {
- printf("Error: %s\n", strerror(errno));
+ printf("calloc: %d\n", errno);
return;
}
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)) {
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:
}
if (read(fd, &ch, sizeof(ch)) != sizeof(ch)) {
- printf("Error: %s\n", strerror(errno));
+ printf("read: %d\n", errno);
return ECORE_CALLBACK_CANCEL;
}
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;
}
}
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;
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;
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;
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();
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);
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;
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 {
}
if (setvbuf(stdout, (char *)NULL, _IONBF, 0) != 0) {
- printf("Error: %s\n", strerror(errno));
+ printf("setvbuf: %d\n", errno);
}
init_directory();
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;
}