HAPI int script_handler_destroy(struct script_info *info)
{
struct block *block;
+ int ret;
+
if (!info || !info->port) {
ErrPrint("port is not valid\n");
return LB_STATUS_ERROR_INVALID;
return LB_STATUS_ERROR_INVALID;
}
- if (info->port->destroy(info->port_data) < 0)
- ErrPrint("Failed to destroy port, but go ahead\n");
+ ret = info->port->destroy(info->port_data);
+ if (ret < 0)
+ ErrPrint("Failed to destroy port, but go ahead: %d\n", ret);
fb_destroy(info->fb);
return LB_STATUS_ERROR_IO;
}
- DbgPrint("Parsing %s\n", descfile);
+ DbgPrint("Start parsing %s\n", descfile);
state = UNKNOWN;
field_idx = 0;
if (!isspace(ch) && ch != EOF) {
ErrPrint("%d: Syntax error: Desc is not started with '{' or space - (%c = 0x%x)\n", lineno, ch, ch);
- fclose(fp);
+ if (fclose(fp) != 0)
+ ErrPrint("fclose: %s\n", strerror(errno));
return LB_STATUS_ERROR_INVALID;
}
break;
block = calloc(1, sizeof(*block));
if (!block) {
ErrPrint("Heap: %s\n", strerror(errno));
- fclose(fp);
+ if (fclose(fp) != 0)
+ ErrPrint("fclose: %s\n", strerror(errno));
return LB_STATUS_ERROR_MEMORY;
}
goto errout;
}
- fclose(fp);
+ if (fclose(fp) != 0)
+ ErrPrint("fclose: %s\n", strerror(errno));
return LB_STATUS_SUCCESS;
errout:
ErrPrint("Parse error at %d file %s\n", lineno, util_basename(descfile));
if (block)
delete_block(block);
- fclose(fp);
+ if (fclose(fp) != 0)
+ ErrPrint("fclose: %s\n", strerror(errno));
return LB_STATUS_ERROR_INVALID;
}
path = malloc(pathlen);
if (!path) {
ErrPrint("Heap: %s %d\n", strerror(errno), pathlen);
- closedir(dir);
+ if (closedir(dir) < 0)
+ ErrPrint("closedir: %s\n", strerror(errno));
return LB_STATUS_ERROR_MEMORY;
}
if (!item) {
ErrPrint("Heap: %s\n", strerror(errno));
DbgFree(path);
- closedir(dir);
+ if (closedir(dir) < 0)
+ ErrPrint("closedir: %s\n", strerror(errno));
return LB_STATUS_ERROR_MEMORY;
}
if (!item->handle) {
ErrPrint("Error: %s\n", dlerror());
DbgFree(item);
- closedir(dir);
+ if (closedir(dir) < 0)
+ ErrPrint("closedir: %s\n", strerror(errno));
return LB_STATUS_ERROR_FAULT;
}
s_info.script_port_list = eina_list_append(s_info.script_port_list, item);
}
- closedir(dir);
+ if (closedir(dir) < 0)
+ ErrPrint("closedir: %s\n", strerror(errno));
+
return LB_STATUS_SUCCESS;
errout:
ErrPrint("Error: %s\n", dlerror());
- dlclose(item->handle);
+ if (dlclose(item->handle) != 0)
+ ErrPrint("dlclose: %s\n", strerror(errno));
DbgFree(item);
- closedir(dir);
+ if (closedir(dir) < 0)
+ ErrPrint("closedir: %s\n", strerror(errno));
return LB_STATUS_ERROR_FAULT;
}
*/
EINA_LIST_FREE(s_info.script_port_list, item) {
item->fini();
- dlclose(item->handle);
+ if (dlclose(item->handle) != 0)
+ ErrPrint("dlclose: %s\n", strerror(errno));
DbgFree(item);
}