igzip: exit with status 1 in applications upon failure

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
This commit is contained in:
Pablo de Lara
2025-09-23 08:51:11 +00:00
parent 9f77f65dbc
commit bfc99b6a18
9 changed files with 75 additions and 59 deletions

View File

@@ -48,17 +48,17 @@ main(int argc, char *argv[])
if (argc != 3) {
fprintf(stderr, "Usage: igzip_example infile outfile\n");
exit(0);
exit(1);
}
in = fopen(argv[1], "rb");
if (!in) {
fprintf(stderr, "Can't open %s for reading\n", argv[1]);
exit(0);
exit(1);
}
out = fopen(argv[2], "wb");
if (!out) {
fprintf(stderr, "Can't open %s for writing\n", argv[2]);
exit(0);
exit(1);
}
printf("igzip_example\nWindow Size: %d K\n", IGZIP_HIST_SIZE / 1024);
@@ -74,7 +74,7 @@ main(int argc, char *argv[])
stream.level_buf_size = ISAL_DEF_LVL1_DEFAULT;
if (stream.level_buf == 0) {
printf("Failed to allocate level compression buffer\n");
exit(0);
exit(1);
}
}