diff options
author | Phillip Lougher <phillip@squashfs.org.uk> | 2013-02-21 22:13:09 +0000 |
---|---|---|
committer | Phillip Lougher <phillip@squashfs.org.uk> | 2013-02-21 22:13:09 +0000 |
commit | 2a7a6215974cf434400144dea9f19d31ca0c4c85 (patch) | |
tree | a66f85a70edb9b02a8b9df530bb2632082673965 /squashfs-tools | |
parent | b0881af7a61a139b38e853dd25ae05f73ec9c8f7 (diff) | |
download | squashfs-tools-2a7a6215974cf434400144dea9f19d31ca0c4c85.tar.gz |
error: add MEM_ERROR() macro
Add a new MEM_ERROR() macro that prints out of space with
the function it occurred in, and then aborts mksquashfs,
restoring the original filesystem if appending.
This macro allows "Out of memory" handling to be regularised
accross Mksquashfs, rather than at present where every
out of memory error has a different and hand crafted
error message.
Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
Diffstat (limited to 'squashfs-tools')
-rw-r--r-- | squashfs-tools/error.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/squashfs-tools/error.h b/squashfs-tools/error.h index a3324ad..a782b34 100644 --- a/squashfs-tools/error.h +++ b/squashfs-tools/error.h @@ -57,3 +57,10 @@ extern void prep_exit_mksquashfs(); progressbar_error("FATAL ERROR:" s, ##args); \ EXIT_MKSQUASHFS();\ } while(0) + +#define MEM_ERROR() \ + do {\ + progressbar_error("FATAL ERROR: Out of memory (%s)\n", \ + __func__); \ + EXIT_MKSQUASHFS();\ + } while(0) |