disks: Minor changes (Linux)
This commit is contained in:
parent
d7cc4d5203
commit
61e3b9b153
|
@ -234,7 +234,6 @@ disks_get(void)
|
||||||
#elif defined(__linux__)
|
#elif defined(__linux__)
|
||||||
char *name;
|
char *name;
|
||||||
Eina_List *devs, *list;
|
Eina_List *devs, *list;
|
||||||
char buf[4096];
|
|
||||||
const char *disk_search = "/dev/disk/by-uuid";
|
const char *disk_search = "/dev/disk/by-uuid";
|
||||||
|
|
||||||
devs = ecore_file_ls(disk_search);
|
devs = ecore_file_ls(disk_search);
|
||||||
|
@ -248,8 +247,7 @@ disks_get(void)
|
||||||
|
|
||||||
EINA_LIST_FREE(devs, name)
|
EINA_LIST_FREE(devs, name)
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf), "%s/%s", disk_search, name);
|
char *real = realpath(eina_slstr_printf("%s/%s", disk_search, name), NULL);
|
||||||
char *real = realpath(buf, NULL);
|
|
||||||
if (real)
|
if (real)
|
||||||
{
|
{
|
||||||
list = eina_list_append(list, real);
|
list = eina_list_append(list, real);
|
||||||
|
@ -263,8 +261,7 @@ disks_get(void)
|
||||||
devs = ecore_file_ls("/dev/mapper");
|
devs = ecore_file_ls("/dev/mapper");
|
||||||
EINA_LIST_FREE(devs, name)
|
EINA_LIST_FREE(devs, name)
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf), "/dev/mapper/%s", name);
|
list = eina_list_append(list, strdup(eina_slstr_printf("/dev/mapper/%s", name)));
|
||||||
list = eina_list_append(list, strdup(name));
|
|
||||||
free(name);
|
free(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -484,7 +484,6 @@ _memory_usage_get(meminfo_t *memory)
|
||||||
fields++;
|
fields++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (fields >= 8)
|
if (fields >= 8)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue