return TRUE;
}
-static void
+static struct uuidCache_s*
uuidcache_init(void)
{
dbg("DBG: uuidCache=%x, uuidCache");
if (uuidCache)
- return;
+ return uuidCache;
/* We were scanning /proc/partitions
* and /proc/sys/dev/cdrom/info here.
NULL, /* dir_action */
NULL, /* userData */
0 /* depth */);
+
+ return uuidCache;
}
#define UUID 1
{
struct uuidCache_s *uc;
- uuidcache_init();
- uc = uuidCache;
-
+ uc = uuidcache_init();
while (uc) {
switch (n) {
case UUID:
/* Used by blkid */
void display_uuid_cache(void)
{
- struct uuidCache_s *u;
-
- uuidcache_init();
- u = uuidCache;
- while (u) {
- printf("%s:", u->device);
- if (u->label[0])
- printf(" LABEL=\"%s\"", u->label);
- if (u->uc_uuid[0])
- printf(" UUID=\"%s\"", u->uc_uuid);
+ struct uuidCache_s *uc;
+
+ uc = uuidcache_init();
+ while (uc) {
+ printf("%s:", uc->device);
+ if (uc->label[0])
+ printf(" LABEL=\"%s\"", uc->label);
+ if (uc->uc_uuid[0])
+ printf(" UUID=\"%s\"", uc->uc_uuid);
#if ENABLE_FEATURE_BLKID_TYPE
- if (u->type)
- printf(" TYPE=\"%s\"", u->type);
+ if (uc->type)
+ printf(" TYPE=\"%s\"", uc->type);
#endif
bb_putchar('\n');
- u = u->next;
+ uc = uc->next;
}
}
{
struct uuidCache_s *uc;
- uuidcache_init();
- uc = uuidCache;
+ uc = uuidcache_init();
while (uc) {
if (uc->label[0] && strcmp(spec, uc->label) == 0) {
return xstrdup(uc->device);
{
struct uuidCache_s *uc;
- uuidcache_init();
- uc = uuidCache;
+ uc = uuidcache_init();
while (uc) {
/* case of hex numbers doesn't matter */
if (strcasecmp(spec, uc->uc_uuid) == 0) {