Paul Eggert wrote on Wed, Aug 05, 2020: > On 8/5/20 2:58 PM, Dominique Martinet wrote: > >if the second read fails with EIO then at that point in the loop ret < 0 > >and full_read returns -1. > > Are you looking at the same source code I am? There is no "ret < 0" > in lib/full-write.c - at least, not in my copy of GNU Tar (I'm > looking at current git as built via "./bootstrap").
Appologies, I was indeed looking at another implementation, that's what I get for blindly trusting cscope which can't follow the couple of #defines to get there. You are correct that the caller should be adapted if we want to use it as is, the comment above the function definition suggests comparing errno with 0 when the return value is less than the requested value to check if that was EOF or an error. I personally find the other implementation cscope had found in gnulib/tests/test-nonblocking-reader.h easier to use but that makes sense for write and probably doesn't deserve trying to split the implementation at this point... :) Sorry for the confusion, I'll let you two hash it out it seems to be in good hands. On the 9p side I'm still thinking this through, need to discuss this a bit more. -- Dominique | Asmadeus