chiark / gitweb /
rules: Ubuntu merge - use group "cdrom"
[elogind.git] / extras / volume_id / lib / volume_id.c
index a93ade6427363176b68010cc9f18f57021380cf5..48bfd88624d323b7922370d9b68950bee41f54b5 100644 (file)
@@ -219,6 +219,19 @@ int volume_id_get_uuid_raw(struct volume_id *id, const uint8_t **uuid, size_t *l
        return 1;
 }
 
+int volume_id_get_uuid_sub(struct volume_id *id, const char **uuid)
+{
+       if (id == NULL)
+               return 0;
+       if (uuid == NULL)
+               return 0;
+       if (id->usage_id == VOLUME_ID_UNUSED)
+               return 0;
+
+       *uuid = id->uuid_sub;
+       return 1;
+}
+
 /**
  * volume_id_get_usage:
  * @id: Probing context.
@@ -446,7 +459,7 @@ int volume_id_probe_filesystem(struct volume_id *id, uint64_t off, uint64_t size
                                info("signature '%s' %i detected\n", id->type, i);
                                if (id->force_unique_result)
                                        force_unique_result = 1;
-                               if (found && force_unique_result) {
+                               if (found > 0 && force_unique_result) {
                                        info("conflicting signatures found, skip results\n");
                                        return -1;
                                }