if (write(fd, so_fname, strlen(so_fname)) != strlen(so_fname)) {
ErrPrint("Failed to recording the fault SO filename (%s)\n", so_fname);
}
- close(fd);
+ if (close(fd) < 0) {
+ ErrPrint("close: %s\n", strerror(errno));
+ }
}
}
}
heap_monitor_del_target(item->so_fname);
- dlclose(item->handle);
+ if (dlclose(item->handle) != 0) {
+ ErrPrint("dlclose: %s\n", dlerror());
+ }
free(item->so_fname);
free(item->pkgname);
free(item);
static struct so_item *new_adaptor(const char *pkgname, const char *abi)
{
struct so_item *item;
+ char *errmsg;
item = calloc(1, sizeof(*item));
if (!item) {
}
fault_unmark_call(pkgname, __func__, __func__, USE_ALARM);
+ errmsg = dlerror();
+ if (errmsg) {
+ DbgPrint("dlerror(can be ignored): %s\n", errmsg);
+ }
+
item->adaptor.create = (adaptor_create_t)dlsym(item->handle, "livebox_create");
if (!item->adaptor.create) {
ErrPrint("symbol: livebox_create - %s\n", dlerror());
static struct so_item *new_livebox(const char *pkgname)
{
struct so_item *item;
+ char *errmsg;
item = calloc(1, sizeof(*item));
if (!item) {
}
fault_unmark_call(pkgname, __func__, __func__, USE_ALARM);
+ errmsg = dlerror();
+ if (errmsg) {
+ DbgPrint("dlerror(can be ignored): %s\n", errmsg);
+ }
+
item->livebox.create = (create_t)dlsym(item->handle, "livebox_create");
if (!item->livebox.create) {
ErrPrint("symbol: livebox_create - %s\n", dlerror());
if (s_info.iwd < 0) {
ErrPrint("Error: %s\n", strerror(errno));
- close(s_info.ifd);
+ if (close(s_info.ifd) < 0) {
+ ErrPrint("close: %s\n", strerror(errno));
+ }
s_info.ifd = LB_STATUS_ERROR_INVALID;
return LB_STATUS_ERROR_IO;
}
}
s_info.iwd = -EINVAL;
- close(s_info.ifd);
+ if (close(s_info.ifd) < 0) {
+ ErrPrint("close: %s\n", strerror(errno));
+ }
s_info.ifd = LB_STATUS_ERROR_INVALID;
return LB_STATUS_ERROR_FAULT;
}
s_info.iwd = LB_STATUS_ERROR_INVALID;
- close(s_info.ifd);
+ if (close(s_info.ifd) < 0) {
+ ErrPrint("close: %s\n", strerror(errno));
+ }
s_info.ifd = LB_STATUS_ERROR_INVALID;
}