[PATCH Try#2 2/3] Make CPIO unpack errors warning-only

Tito farmatito at tiscali.it
Fri Jun 8 11:58:08 UTC 2007


On Friday 08 June 2007 13:24:25 walter harms wrote:
> that i had in mind, do you see a change or merge this unlinks calls ?
> 
> 
> 
> something (read untested) like that:
>   if (..)
> 	myunlink(file_header->name,archive_handle);
> 
> 
> static void myunlink(char *name, archive_handle_t *handle )
> {
>  if ((unlink(name) == -1) && (errno != EISDIR) && (errno != ENOENT) )
> #ifndef CONFIG_CPIO_NONFATAL_UNPACK_ERRORS
> 	 bb_perror_msg_and_die("Couldnt remove old file %s",name);
> #else
> 	bb_perror_msg("Couldnt remove old file %s",name);
> 	data_skip(handle);
> 	return;
> #endif
> }

Maybe like this?
 
static void myunlink(char *name, archive_handle_t *handle )
{
	if ((unlink(name) == -1) && (errno != EISDIR) && (errno != ENOENT) ) {
		bb_perror_msg("cannot remove old file %s",name);
		if  (!ENABLE_FEATURE_CPIO_NONFATAL_UNPACK_ERRORS)
			exit(EXIT_FAILURE);
		data_skip(handle);
	}
}

Ciao,
Tito



More information about the busybox mailing list