Centralized the inquiry whether an image change is pending

This commit is contained in:
Thomas Schmitt 2012-03-03 13:39:50 +00:00
parent 7c42bd8a17
commit f70299dae1
8 changed files with 22 additions and 22 deletions

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2011 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2012 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -1398,7 +1398,7 @@ int Xorriso_tell_media_space(struct XorrisO *xorriso,
isoburn_disc_available_space(drive, burn_options) / (off_t) 2048;
burn_write_opts_free(burn_options);
if(xorriso->volset_change_pending) {
if(Xorriso_change_is_pending(xorriso, 0)) {
ret= Xorriso_write_session(xorriso, 1);
if(ret>0)
(*free_space)-= ret;

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2011 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2012 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -550,7 +550,7 @@ int Xorriso_option_blank(struct XorrisO *xorriso, char *mode, int flag)
return(0);
}
if(xorriso->in_drive_handle == xorriso->out_drive_handle) {
if(xorriso->volset_change_pending) {
if(Xorriso_change_is_pending(xorriso, 0)) {
sprintf(xorriso->info_text,
"%s: Image changes pending. -commit or -rollback first.", cmd);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
@ -1800,7 +1800,7 @@ int Xorriso_option_commit(struct XorrisO *xorriso, int flag)
{
int ret;
if(!xorriso->volset_change_pending) {
if(!Xorriso_change_is_pending(xorriso, 0)) {
sprintf(xorriso->info_text, "-commit: No image modifications pending");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
{ret= 3; goto ex;}

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2011 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2012 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -60,7 +60,7 @@ int Xorriso_option_dev(struct XorrisO *xorriso, char *in_adr, int flag)
}
}
if(xorriso->volset_change_pending && (flag&1)) {
if(Xorriso_change_is_pending(xorriso, 0) && (flag&1)) {
sprintf(xorriso->info_text,
"%s: Image changes pending. -commit or -rollback first",
(flag&2) ? "-dev" : "-indev");
@ -109,7 +109,7 @@ int Xorriso_option_devices(struct XorrisO *xorriso, int flag)
{
int ret;
if(xorriso->volset_change_pending) {
if(Xorriso_change_is_pending(xorriso, 0)) {
sprintf(xorriso->info_text,
"-devices: Image changes pending. -commit or -rollback first");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
@ -331,7 +331,7 @@ int Xorriso_option_eject(struct XorrisO *xorriso, char *which, int flag)
gu_flag|= 2;
else
gu_flag|= 3;
if((gu_flag&1) && xorriso->volset_change_pending) {
if((gu_flag&1) && Xorriso_change_is_pending(xorriso, 0)) {
sprintf(xorriso->info_text,
"-eject: Image changes pending. -commit or -rollback first");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
@ -358,8 +358,8 @@ int Xorriso_option_end(struct XorrisO *xorriso, int flag)
cmd= "-rollback_end";
else
cmd= "-end";
if(xorriso->volset_change_pending) {
if((flag & 1) || xorriso->volset_change_pending != 1)
if(Xorriso_change_is_pending(xorriso, 0)) {
if((flag & 1) || !Xorriso_change_is_pending(xorriso, 1))
which_will= "end the program discarding image changes";
else
which_will= "commit image changes and then end the program";
@ -372,8 +372,8 @@ int Xorriso_option_end(struct XorrisO *xorriso, int flag)
return(2);
}
if(xorriso->volset_change_pending) {
if((flag & 1) || xorriso->volset_change_pending != 1) {
if(Xorriso_change_is_pending(xorriso, 0)) {
if((flag & 1) || !Xorriso_change_is_pending(xorriso, 1)) {
xorriso->volset_change_pending= 0;
} else {
ret= Xorriso_option_commit(xorriso, 1);

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2011 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2012 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -191,7 +191,7 @@ int Xorriso_option_load(struct XorrisO *xorriso, char *adr_mode,
{
int ret;
if(xorriso->volset_change_pending) {
if(Xorriso_change_is_pending(xorriso, 0)) {
sprintf(xorriso->info_text,
"-load: Image changes pending. -commit or -rollback first");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
@ -751,7 +751,7 @@ int Xorriso_option_mount(struct XorrisO *xorriso, char *dev, char *adr_mode,
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
if(xorriso->volset_change_pending) {
if(Xorriso_change_is_pending(xorriso, 0)) {
sprintf(xorriso->info_text,
"%s: Image changes pending. -commit or -rollback first", mnt);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);

View File

@ -293,7 +293,7 @@ int Xorriso_option_print_size(struct XorrisO *xorriso, int flag)
{
int ret, fd;
if(!xorriso->volset_change_pending) {
if(!Xorriso_change_is_pending(xorriso, 0)) {
sprintf(xorriso->info_text,"-print_size: No image modifications pending");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
if(!(flag & 1)) {
@ -586,7 +586,7 @@ int Xorriso_option_rollback(struct XorrisO *xorriso, int flag)
char *indev= NULL, *which_will;
Xorriso_alloc_meM(indev, char, SfileadrL);
if(xorriso->volset_change_pending)
if(Xorriso_change_is_pending(xorriso, 0))
which_will= "revoke the pending image changes";
else
which_will= "reload the image";

View File

@ -2,7 +2,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2011 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2012 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -194,7 +194,7 @@ int Xorriso_restore_is_identical(struct XorrisO *xorriso, void *in_node,
int dummy;
memset(type_text, 0, 5);
if(!xorriso->volset_change_pending)
if(!Xorriso_change_is_pending(xorriso, 0))
return(0);
if(flag&1) {
node= (IsoNode *) in_node;

View File

@ -2528,7 +2528,7 @@ int Xorriso_close_damaged(struct XorrisO *xorriso, int flag)
struct burn_drive *drive;
struct burn_write_opts *burn_options= NULL;
if(xorriso->volset_change_pending) {
if(Xorriso_change_is_pending(xorriso, 0)) {
sprintf(xorriso->info_text,
"Image changes pending. -commit or -rollback first");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);

View File

@ -1 +1 @@
#define Xorriso_timestamP "2012.03.03.104637"
#define Xorriso_timestamP "2012.03.03.134008"