diff --git a/src/error.h b/src/error.h index 283ffd8..8464094 100644 --- a/src/error.h +++ b/src/error.h @@ -34,7 +34,6 @@ * = 0x1 -> LOW * = 0x2 -> MEDIUM * = 0x3 -> HIGH - * = 0x7 -> TOP * bits 19-16 -> Reserved for future usage (maybe message ranges) * bits 15-0 -> Error code */ @@ -52,8 +51,8 @@ */ #define ISO_NONE 0 -/** Operation canceled (ERROR,TOP, -1) */ -#define ISO_CANCELED 0xEA70FFFF +/** Operation canceled (ERROR,HIGH, -1) */ +#define ISO_CANCELED 0xEA30FFFF /** Unknown or unexpected fatal error (FATAL,HIGH, -2) */ #define ISO_FATAL_ERROR 0xF030FFFE diff --git a/src/fs_image.c b/src/fs_image.c index 2e22c3e..8e725c8 100644 --- a/src/fs_image.c +++ b/src/fs_image.c @@ -2238,9 +2238,9 @@ int iso_image_import(IsoImage *image, IsoDataSource *src, /* recursively add image */ ret = iso_add_dir_src_rec(image, image->root, newroot); - + /* error during recursive image addition? */ - if (ret <= 0) { + if (ret < 0) { iso_node_builder_unref(image->builder); goto import_revert; } @@ -2292,7 +2292,7 @@ int iso_image_import(IsoImage *image, IsoDataSource *src, iso_image_set_copyright_file_id(image, data->copyright_file_id); iso_image_set_abstract_file_id(image, data->abstract_file_id); iso_image_set_biblio_file_id(image, data->biblio_file_id); - + if (features != NULL) { features->hasJoliet = data->joliet; features->hasRR = data->rr_version != 0; diff --git a/src/libiso_msgs.h b/src/libiso_msgs.h index 94407a0..7c29a91 100644 --- a/src/libiso_msgs.h +++ b/src/libiso_msgs.h @@ -172,7 +172,7 @@ struct libiso_msgs_item; #define LIBISO_MSGS_PRIO_LOW 0x10000000 #define LIBISO_MSGS_PRIO_MEDIUM 0x20000000 #define LIBISO_MSGS_PRIO_HIGH 0x30000000 -#define LIBISO_MSGS_PRIO_TOP 0x70000000 +#define LIBISO_MSGS_PRIO_TOP 0x7ffffffe /* Do not use this priority for submitting */ #define LIBISO_MSGS_PRIO_NEVER 0x7fffffff diff --git a/src/tree.c b/src/tree.c index a0455f7..e477a93 100644 --- a/src/tree.c +++ b/src/tree.c @@ -491,7 +491,7 @@ int check_special(IsoImage *image, mode_t mode) * Recursively add a given directory to the image tree. * * @return - * 1 continue, 0 stop, < 0 error + * 1 continue, < 0 error (ISO_CANCELED stop) */ int iso_add_dir_src_rec(IsoImage *image, IsoDir *parent, IsoFileSource *dir) { @@ -607,7 +607,7 @@ dir_rec_continue:; } /* while */ iso_file_source_close(dir); - return ret; + return ret < 0 ? ret : ISO_SUCCESS; } int iso_tree_add_dir_rec(IsoImage *image, IsoDir *parent, const char *dir) diff --git a/src/util.c b/src/util.c index e7efd02..0eeaede 100644 --- a/src/util.c +++ b/src/util.c @@ -1039,7 +1039,7 @@ time_t iso_datetime_read_7(const uint8_t *buf) tm.tm_hour = buf[3]; tm.tm_min = buf[4]; tm.tm_sec = buf[5]; - return timegm(&tm) - buf[6] * 60 * 15; + return timegm(&tm) - ((int8_t)buf[6]) * 60 * 15; } time_t iso_datetime_read_17(const uint8_t *buf)