diff options
author | Phillip Lougher <phillip@squashfs.org.uk> | 2013-06-21 02:50:54 +0100 |
---|---|---|
committer | Mohamad Ayyash <mkayyash@google.com> | 2015-02-23 12:36:01 -0800 |
commit | e1daf2ea2a80cc5f82eee3ea6c9bf019649582e8 (patch) | |
tree | d498d45c84d9e7e58bfbaabd577f23b6f1576324 /squashfs-tools/lz4_wrapper.c | |
parent | 4436e4e248174011638fbda85e6a22b40e2b1078 (diff) | |
download | squashfs-tools-e1daf2ea2a80cc5f82eee3ea6c9bf019649582e8.tar.gz |
lz4: add flags field to comp_opts structure
Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
Diffstat (limited to 'squashfs-tools/lz4_wrapper.c')
-rw-r--r-- | squashfs-tools/lz4_wrapper.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/squashfs-tools/lz4_wrapper.c b/squashfs-tools/lz4_wrapper.c index aadf07f..e906093 100644 --- a/squashfs-tools/lz4_wrapper.c +++ b/squashfs-tools/lz4_wrapper.c @@ -92,6 +92,7 @@ failed: static void *lz4_dump_options(int block_size, int *size) { comp_opts.version = LZ4_LEGACY; + comp_opts.flags = 0; SQUASHFS_INSWAP_COMP_OPTS(&comp_opts); *size = sizeof(comp_opts); @@ -133,6 +134,14 @@ static int lz4_extract_options(int block_size, void *buffer, int size) if(comp_opts->version != LZ4_LEGACY) goto failed; + /* + * we currently don't know about any flags, so if the flags field is not + * zero we don't know how that affects compression or decompression, + * which is a comp_opts read failure + */ + if(comp_opts->flags != 0) + goto failed; + return 0; failed: @@ -157,6 +166,13 @@ void lz4_display_options(void *buffer, int size) if(comp_opts->version != LZ4_LEGACY) goto failed; + /* + * we currently don't know about any flags, so if the flags field is not + * zero we don't know how to display that, which is a failure + */ + if(comp_opts->flags != 0) + goto failed; + return; failed: |