Browse Source

Removed stop_on_error, now replaced by iso_set_abort_severity().

release-1.5.4.branch
Vreixo Formoso 14 years ago
parent
commit
c272228590
  1. 1
      demo/iso.c
  2. 1
      demo/iso_grow.c
  3. 1
      demo/iso_modify.c
  4. 1
      demo/iso_ms.c
  5. 6
      src/image.h
  6. 4
      src/libiso_msgs.c
  7. 13
      src/libisofs.h
  8. 32
      src/tree.c

1
demo/iso.c

@ -144,7 +144,6 @@ int main(int argc, char **argv)
iso_tree_set_follow_symlinks(image, 0);
iso_tree_set_ignore_hidden(image, 0);
iso_tree_set_ignore_special(image, 0);
iso_tree_set_stop_on_error(image, 0);
iso_set_abort_severity("SORRY");
result = iso_tree_add_dir_rec(image, iso_image_get_root(image), argv[optind]);

1
demo/iso_grow.c

@ -90,7 +90,6 @@ int main(int argc, char **argv)
}
iso_tree_set_follow_symlinks(image, 0);
iso_tree_set_ignore_hidden(image, 0);
iso_tree_set_stop_on_error(image, 0);
if (!burn_initialize()) {
err(1, "Can't init libburn");

1
demo/iso_modify.c

@ -97,7 +97,6 @@ int main(int argc, char **argv)
}
iso_tree_set_follow_symlinks(image, 0);
iso_tree_set_ignore_hidden(image, 0);
iso_tree_set_stop_on_error(image, 0);
/* import previous image */
result = iso_image_import(image, src, &ropts, NULL);

1
demo/iso_ms.c

@ -97,7 +97,6 @@ int main(int argc, char **argv)
}
iso_tree_set_follow_symlinks(image, 0);
iso_tree_set_ignore_hidden(image, 0);
iso_tree_set_stop_on_error(image, 0);
/* import previous image */
ropts.block = atoi(argv[1]);

6
src/image.h

@ -40,12 +40,6 @@ struct Iso_Image_Rec_Opts
*/
unsigned int ignore_hidden : 1;
/**
* Whether to stop on an error. Some errors, such as memory errors,
* always cause a stop
*/
unsigned int stop_on_error : 1;
/**
* Flags that determine what special files should be ignore. It is a
* bitmask:

4
src/libiso_msgs.c

@ -252,6 +252,8 @@ int libiso_msgs__text_to_sev(char *severity_name, int *severity,
*severity= LIBISO_MSGS_SEV_ABORT;
else if(strncmp(severity_name,"FATAL",5)==0)
*severity= LIBISO_MSGS_SEV_FATAL;
else if(strncmp(severity_name,"ERROR",5)==0)
*severity= LIBISO_MSGS_SEV_ERROR;
else if(strncmp(severity_name,"SORRY",5)==0)
*severity= LIBISO_MSGS_SEV_SORRY;
else if(strncmp(severity_name,"WARNING",7)==0)
@ -289,6 +291,8 @@ int libiso_msgs__sev_to_text(int severity, char **severity_name,
*severity_name= "ABORT";
else if(severity>=LIBISO_MSGS_SEV_FATAL)
*severity_name= "FATAL";
else if(severity>=LIBISO_MSGS_SEV_ERROR)
*severity_name= "ERROR";
else if(severity>=LIBISO_MSGS_SEV_SORRY)
*severity_name= "SORRY";
else if(severity>=LIBISO_MSGS_SEV_WARNING)

13
src/libisofs.h

@ -1540,19 +1540,6 @@ void iso_tree_set_ignore_special(IsoImage *image, int skip);
*/
int iso_tree_get_ignore_special(IsoImage *image);
/**
* Set whether to stop or not when an error happens when adding recursively a
* directory to the iso tree. Default value is to skip file and continue.
*/
void iso_tree_set_stop_on_error(IsoImage *image, int stop);
/**
* Get current setting for stop_on_error.
*
* @see iso_tree_set_stop_on_error
*/
int iso_tree_get_stop_on_error(IsoImage *image);
/**
* Add a new node to the image tree, from an existing file.
*

32
src/tree.c

@ -362,25 +362,6 @@ int iso_tree_get_ignore_special(IsoImage *image)
return image->recOpts.ignore_special;
}
/**
* Set whether to stop or not when an error happens when adding recursively a
* directory to the iso tree. Default value is to skip file and continue.
*/
void iso_tree_set_stop_on_error(IsoImage *image, int stop)
{
image->recOpts.stop_on_error = stop ? 1 : 0;
}
/**
* Get current setting for stop_on_error.
*
* @see iso_tree_set_stop_on_error
*/
int iso_tree_get_stop_on_error(IsoImage *image)
{
return image->recOpts.stop_on_error;
}
static
int iso_tree_add_node_builder(IsoImage *image, IsoDir *parent,
IsoFileSource *src, IsoNodeBuilder *builder,
@ -507,7 +488,9 @@ int iso_add_dir_src_rec(IsoImage *image, IsoDir *parent, IsoFileSource *dir)
ret = iso_file_source_open(dir);
if (ret < 0) {
char *path = iso_file_source_get_path(dir);
iso_msg_debug(image->id, "Can't open dir %s", path);
/* instead of the probable error, we throw a warning */
ret = iso_msg_submit(image->id, ISO_FILE_CANT_ADD, ret,
"Can't open dir %s", path);
free(path);
return ret;
}
@ -600,9 +583,12 @@ dir_rec_continue:;
free(path);
iso_file_source_unref(file);
/* TODO check for error severity to decide what to do */
if (ret == ISO_CANCELED || (ret < 0 && image->recOpts.stop_on_error)) {
break;
/* check for error severity to decide what to do */
if (ret < 0) {
ret = iso_msg_submit(image->id, ret, 0, NULL);
if (ret < 0) {
break;
}
}
} /* while */

Loading…
Cancel
Save