Fixed a potential blind spot of 1 second in -disk_dev_ino comparison

This commit is contained in:
2009-04-03 17:20:33 +00:00
parent e3eaea1a4e
commit b4952da4e6
5 changed files with 86 additions and 7 deletions

View File

@ -527,8 +527,12 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
struct burn_drive *drive, *out_drive, *in_drive;
enum burn_disc_status state;
IsoImage *volset = NULL;
IsoNode *root_node;
struct isoburn_read_opts *ropts= NULL;
char libburn_adr[SfileadrL], *boot_fate, *sev;
size_t value_length;
char *value= NULL;
double num;
static int no_rr_or_joliet= 0;
@ -541,6 +545,8 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
ret= Xorriso_give_up_drive(xorriso, (flag&3)|8);
if(ret<=0)
return(ret);
if(flag & 1)
xorriso->isofs_st_out= time(0) - 1;
ret= Xorriso_auto_driveadr(xorriso, adr, libburn_adr, 0);
if(ret <= 0)
@ -778,6 +784,21 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
Xorriso_record_boot_info(xorriso, 0);
}
if(flag & 1) {
/* Look for isofs.st and put it into xorriso->isofs_st_in */;
root_node= (IsoNode *) iso_image_get_root(volset);
ret= iso_node_lookup_attr(root_node, "isofs.st", &value_length, &value, 0);
if(ret > 0) {
if(value_length > 0) {
sscanf(value, "%lf", &num);
if(num > 0)
xorriso->isofs_st_in= num;
}
free(value);
}
}
if(!(flag&32)) {
Xorriso_toc(xorriso, 1 | 8);
if(xorriso->loaded_volid[0]!=0) {
@ -845,6 +866,8 @@ int Xorriso_give_up_drive(struct XorrisO *xorriso, int flag)
xorriso->in_volset_handle= NULL;
Sectorbitmap_destroy(&(xorriso->in_sector_map), 0);
xorriso->loaded_volid[0]= 0;
xorriso->isofs_st_out= time(0) - 1;
xorriso->isofs_st_in= 0;
xorriso->volset_change_pending= 0;
xorriso->no_volset_present= 0;
xorriso->loaded_boot_bin_lba= 0;
@ -1314,6 +1337,19 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
}
}
if(xorriso->do_aaip & 16) {
/* Overwrite isofs.st of root node by xorriso->isofs_st_out */
char *name= "isofs.st";
char timestamp[16], *value= timestamp;
size_t value_length;
sprintf(timestamp, "%.f", (double) xorriso->isofs_st_out);
value_length= strlen(timestamp);
Xorriso_setfattr(xorriso, NULL, "/", (size_t) 1, &name,
&value_length, &value, 2 | 8);
}
isoburn_igopt_set_level(sopts, 3);
isoburn_igopt_set_extensions(sopts, 1 | ((!!xorriso->do_joliet)<<1) |
((!!(xorriso->do_aaip & (2 | 8 | 16 | 256))) << 5));