Il 02/10/2012 13:06, Juan Quintela ha scritto: >> Perhaps the other way round: >> > >> > if (ret < 0) { >> > ret2 = -1; >> > } >> > ... >> > return ret2; > This lost the 1st errno value.
Right, I meant ret2 = ret; > The other way around we preserve it. I think with "ret2 = ret;" it is the same. The way you have it in your patch, you could truncate a positive ssize_t return value from buffered_flush that does not fit in an int. Theoretical, I know, but I can see Coverity spotting it from a mile... Paolo