From 1d6fdf51dc7e6544ef9f821deb5a15d6ad15b393 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Wed, 23 Jun 2010 19:54:51 +0200 Subject: [PATCH] New error code ISO_BOOT_NO_CATALOG --- libisofs/eltorito.c | 2 ++ libisofs/libisofs.h | 15 +++++++++++---- libisofs/messages.c | 2 ++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/libisofs/eltorito.c b/libisofs/eltorito.c index 5e63eae..70f4b88 100644 --- a/libisofs/eltorito.c +++ b/libisofs/eltorito.c @@ -653,6 +653,8 @@ int iso_image_add_boot_image(IsoImage *image, const char *image_path, struct el_torito_boot_catalog *catalog = image->bootcat; ElToritoBootImage *boot_img; + if(catalog == NULL) + return ISO_BOOT_NO_CATALOG; if (catalog->num_bootimages >= Libisofs_max_boot_imageS) return ISO_BOOT_IMAGE_OVERFLOW; ret = create_image(image, image_path, type, &boot_img); diff --git a/libisofs/libisofs.h b/libisofs/libisofs.h index 8cb6740..085cdb1 100644 --- a/libisofs/libisofs.h +++ b/libisofs/libisofs.h @@ -2354,6 +2354,8 @@ int iso_image_set_boot_image(IsoImage *image, const char *image_path, * See iso_image_set_boot_image * @return * 1 on success, < 0 on error + * ISO_BOOT_NO_CATALOG means iso_image_set_boot_image() + * was not called first. * * @since 0.6.32 */ @@ -2361,8 +2363,6 @@ int iso_image_add_boot_image(IsoImage *image, const char *image_path, enum eltorito_boot_media_type type, int flag, ElToritoBootImage **boot); -/* TODO #00026 : add support for "hidden" bootable images. */ - /** * Get the El-Torito boot catalog and the default boot image of an ISO image. * @@ -2474,12 +2474,11 @@ int iso_image_set_boot_catalog_weight(IsoImage *image, int sort_weight); * @return * 0= no boot catalog attached , 1= ok , <0 = error * - * @since 0.6.32 + * @since 0.6.34 */ int iso_image_set_boot_catalog_hidden(IsoImage *image, int hide_attrs); - /** * Get the boot media type as of parameter "type" of iso_image_set_boot_image() * resp. iso_image_add_boot_image(). @@ -3724,6 +3723,10 @@ int iso_tree_get_follow_symlinks(IsoImage *image); * when adding a directory recursively. * Default behavior is to not ignore them. * + * Clarification: This is not related to the IsoNode property to be hidden + * in one or more of the resulting image trees as of + * IsoHideNodeFlag and iso_node_set_hidden(). + * * @since 0.6.2 */ void iso_tree_set_ignore_hidden(IsoImage *image, int skip); @@ -5756,6 +5759,10 @@ int iso_md5_match(char first_md5[16], char second_md5[16]); /** Too many boot images (FAILURE,HIGH, -69) */ #define ISO_BOOT_IMAGE_OVERFLOW 0xE830FFBA +/** No boot catalog created yet ((FAILURE,HIGH, -70) */ /* @since 0.6.34 */ +#define ISO_BOOT_NO_CATALOG 0xE830FFB9 + + /** * Error on file operation (FAILURE,HIGH, -128) * (take a look at more specified error codes below) diff --git a/libisofs/messages.c b/libisofs/messages.c index 30f43b7..69c0066 100644 --- a/libisofs/messages.c +++ b/libisofs/messages.c @@ -284,6 +284,8 @@ const char *iso_error_to_msg(int errcode) return "Detected file content changes while it was written into the image"; case ISO_SCDBACKUP_TAG_NOT_0: return "Session does not start at LBA 0. scdbackup checksum tag not written."; + case ISO_BOOT_NO_CATALOG: + return "No boot catalog created yet"; default: return "Unknown error"; }