diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-26 17:21:44 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-26 17:22:53 +0200 |
commit | ff4a9235feb4237854ff102c4dc7cf4645d6a116 (patch) | |
tree | 18017f7f1b6776ef76360fef0ff127d42f3007cd /lib/sqfs/data_writer/serial.c | |
parent | 248765bd9f6ead4fbe4e5822bcaf46b85fe1687f (diff) |
Add file API stub to sqfs data writer
Basically move the state tracking from the old data writer over to
the new one.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/data_writer/serial.c')
-rw-r--r-- | lib/sqfs/data_writer/serial.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/sqfs/data_writer/serial.c b/lib/sqfs/data_writer/serial.c index 38dcc58..916f497 100644 --- a/lib/sqfs/data_writer/serial.c +++ b/lib/sqfs/data_writer/serial.c @@ -35,7 +35,15 @@ void sqfs_data_writer_destroy(sqfs_data_writer_t *proc) data_writer_cleanup(proc); } -int sqfs_data_writer_enqueue(sqfs_data_writer_t *proc, sqfs_block_t *block) +int test_and_set_status(sqfs_data_writer_t *proc, int status) +{ + if (proc->status == 0) + proc->status = status; + + return proc->status; +} + +int data_writer_enqueue(sqfs_data_writer_t *proc, sqfs_block_t *block) { sqfs_block_t *fragblk = NULL; @@ -44,12 +52,6 @@ int sqfs_data_writer_enqueue(sqfs_data_writer_t *proc, sqfs_block_t *block) return proc->status; } - if (block->flags & ~SQFS_BLK_USER_SETTABLE_FLAGS) { - proc->status = SQFS_ERROR_UNSUPPORTED; - free(block); - return proc->status; - } - if (block->flags & SQFS_BLK_IS_FRAGMENT) { block->checksum = crc32(0, block->data, block->size); |