Centralized the inquiry whether an image change is pending
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user