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
}

i am unsure about the second errno condition, any idea ?

re,
 wh



Andy Green wrote:
> walter harms wrote:
>> hi andy,
>> i took a quick look at the patch and noticed:
>>
>>  bb_perror_msg_and_die("cannot remove old file");
>>
>> any reason NOT to tell the user what file like in the second part ?
>>
>> bb_perror_msg_and_die("cannot remove old file %s",
>>                                         file_header->name);
>>
> 
> Thanks for the feedback, here we go.
> 
> -Andy
> 
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to