diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2007-11-26 01:09:03 +0100 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2007-11-26 01:09:03 +0100 |
commit | 1e8b8e564ca66c11b79278156b834920219d9845 (patch) | |
tree | 1635c9eef97abbf3c807f51c69d681834eb02319 /extras/volume_id | |
parent | d7515c7bb95748f3afc2156451dd10f3e0ee4c84 (diff) |
libvolume_id: squashfs - add endianess support for LZMA compression
Diffstat (limited to 'extras/volume_id')
-rw-r--r-- | extras/volume_id/lib/squashfs.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/extras/volume_id/lib/squashfs.c b/extras/volume_id/lib/squashfs.c index 70b322df0c..035d6fb22a 100644 --- a/extras/volume_id/lib/squashfs.c +++ b/extras/volume_id/lib/squashfs.c @@ -27,7 +27,7 @@ #include "util.h" #define SQUASHFS_MAGIC 0x73717368 -#define SQUASHFS_MAGIC_LZMA 0x73687371 +#define SQUASHFS_MAGIC_LZMA 0x71736873 struct squashfs_super { uint32_t s_magic; @@ -51,21 +51,16 @@ int volume_id_probe_squashfs(struct volume_id *id, uint64_t off, uint64_t size) if (sqs == NULL) return -1; - if (sqs->s_magic == SQUASHFS_MAGIC) { + if (sqs->s_magic == SQUASHFS_MAGIC || sqs->s_magic == SQUASHFS_MAGIC_LZMA) { snprintf(id->type_version, sizeof(id->type_version), "%u.%u", sqs->s_major, sqs->s_minor); goto found; } - if (sqs->s_magic == bswap_32(SQUASHFS_MAGIC)) { + if (sqs->s_magic == bswap_32(SQUASHFS_MAGIC) || sqs->s_magic == bswap_32(SQUASHFS_MAGIC_LZMA)) { snprintf(id->type_version, sizeof(id->type_version), "%u.%u", bswap_16(sqs->s_major), bswap_16(sqs->s_minor)); goto found; } - if (sqs->s_magic == bswap_32(SQUASHFS_MAGIC_LZMA)) { - snprintf(id->type_version, sizeof(id->type_version), "%u.%u", - sqs->s_major, sqs->s_minor); - goto found; - } return -1; |