to avoid resource leak, add free function.
And added return value
}
count++;
}
+ closedir(dir);
return count;
}
/* check disk available size */
if (fd < 0) {
PRT_TRACE_ERR("can't open the '%s': %s", buf, strerror(errno));
snprintf(buf, sizeof(buf), "%s%d", MMC_DEV, blk_num);
- }
- close(fd);
+ } else
+ close(fd);
switch (inserted_type) {
case FS_TYPE_FAT:
static int add_node(struct haptic_node *node)
{
haptic_head = g_list_append(haptic_head, node);
+ return 0;
}
static int delete_node(struct haptic_node *node)
{
haptic_head = g_list_remove(haptic_head, node);
+ return 0;
}
static struct haptic_node *find_node(int handle)