Restricted split part recognition to directories with a complete part set

This commit is contained in:
2009-09-28 17:32:27 +00:00
parent 3adb23071f
commit 9f26cadda4
3 changed files with 41 additions and 54 deletions

View File

@ -8026,6 +8026,8 @@ int Xorriso_findi_test(struct XorrisO *xorriso, struct FindjoB *job,
/* @param flag bit0= recursion
bit1= do not count deleted files with rm and rm_r
bit2= do not dive into split file directories
(implicitly given with actions 14=compare and 17=update)
@return <=0 error, 1= ok , 2= dir node and path has been deleted
*/
int Xorriso_findi(struct XorrisO *xorriso, struct FindjoB *job,
@ -8033,7 +8035,7 @@ int Xorriso_findi(struct XorrisO *xorriso, struct FindjoB *job,
void *dir_node_generic, char *dir_path,
struct stat *dir_stbuf, int depth, int flag)
{
int ret, action= 0, hflag, deleted= 0, no_dive= 0, split_flag;
int ret, action= 0, hflag, deleted= 0, no_dive= 0;
IsoDirIter *iter= NULL;
IsoDir *dir_node= NULL;
IsoNode *node, *iso_node;
@ -8128,11 +8130,9 @@ int Xorriso_findi(struct XorrisO *xorriso, struct FindjoB *job,
}
if(no_dive || !LIBISO_ISDIR((IsoNode *) dir_node))
{ret= 1; goto ex;}
split_flag= 1 | 2;
if(action == 14 || action == 17)
split_flag &= ~2;
if(Xorriso_is_split(xorriso, dir_path, (IsoNode *) dir_node, split_flag)>0)
{ret= 1; goto ex;}
if(action == 14 || action == 17 || (flag & 4))
if(Xorriso_is_split(xorriso, dir_path, (IsoNode *) dir_node, 1)>0)
{ret= 1; goto ex;}
mem= boss_mem;
hflag= 1;
@ -8354,7 +8354,7 @@ int Xorriso_path_from_lba(struct XorrisO *xorriso, IsoNode *node, int lba,
int Xorriso_findi_sorted(struct XorrisO *xorriso, struct FindjoB *job,
off_t boss_mem, int filec, char **filev, int flag)
{
int i, ret;
int i, ret, find_flag= 0;
struct FindjoB array_job, *proxy_job= NULL, *hindmost= NULL, *hmboss= NULL;
struct stat dir_stbuf;
IsoNode *node;
@ -8363,6 +8363,8 @@ int Xorriso_findi_sorted(struct XorrisO *xorriso, struct FindjoB *job,
array_job.start_path= NULL;
if(job->action == 14 || job->action == 17)
find_flag|= 4;
if(job->action>=9 && job->action<=13) { /* actions which have own findjobs */
/* array_job replaces the hindmost job in the chain */
for(hindmost= job; hindmost->subjob != NULL; hindmost= hindmost->subjob)
@ -8391,7 +8393,7 @@ int Xorriso_findi_sorted(struct XorrisO *xorriso, struct FindjoB *job,
if(ret <= 0)
goto ex;
ret= Xorriso_findi(xorriso, proxy_job, NULL, boss_mem, NULL,
filev[i], &dir_stbuf, 0, 0);
filev[i], &dir_stbuf, 0, find_flag);
if(ret <= 0)
goto ex;
}
@ -8410,7 +8412,7 @@ int Xorriso_findi_sorted(struct XorrisO *xorriso, struct FindjoB *job,
if(ret <= 0)
goto ex;
ret= Xorriso_findi(xorriso, job, NULL, boss_mem, NULL,
filev[i], &dir_stbuf, 0, 0);
filev[i], &dir_stbuf, 0, find_flag);
if(ret <= 0)
if(Xorriso_eval_problem_status(xorriso, ret, 1|2)<0)
goto ex;
@ -8440,7 +8442,7 @@ int Xorriso_findi_sorted(struct XorrisO *xorriso, struct FindjoB *job,
if(ret <= 0)
goto ex;
ret= Xorriso_findi(xorriso, proxy_job, NULL, mem_needed, NULL,
filev[i], &dir_stbuf, 0, 0);
filev[i], &dir_stbuf, 0, find_flag);
if(ret <= 0)
goto ex;
}
@ -9238,8 +9240,7 @@ int Xorriso_iso_file_close(struct XorrisO *xorriso, void **stream, int flag)
/* @param flag bit0= in_node is valid, do not resolve iso_adr
bit1= insist in complete collection of part files
??? <<< bit2= recognize and parse split parts despite
bit2= recognize and parse split parts despite
xorrio->split_size <= 0
*/
int Xorriso_identify_split(struct XorrisO *xorriso, char *iso_adr,
@ -9262,10 +9263,6 @@ int Xorriso_identify_split(struct XorrisO *xorriso, char *iso_adr,
*count= 0;
*parts= NULL;
/* <<< remove bit1 and hardcode it
flag|= 2;
*/
if(xorriso->split_size <= 0 && !(flag & 4))
return(0);
@ -9323,7 +9320,7 @@ cannot_iter:;
{ret= 0; goto ex;}
(*count)++;
}
if(*count <= 0 || (*count != first_total_parts && (flag & 2)))
if(*count <= 0 || *count != first_total_parts)
{ret= 0; goto ex;}
ret= Splitparts_new(parts, (*count)+1, 0); /* (have one end marker item) */
@ -9366,7 +9363,7 @@ cannot_iter:;
incomplete= 1;
memcpy(total_stbuf, &first_stbuf, sizeof(struct stat));
total_stbuf->st_size= total_bytes;
ret= !(overlapping || ((flag&2)&&incomplete));
ret= !(overlapping || incomplete);
ex:;
if(iter!=NULL)
iso_dir_iter_free(iter);