shejialuo <shejialuo@xxxxxxxxx> writes: > You are right. Actually, I just want to avoid assigning the `fd` to -1. Why not? Between leaving it uninitialized and explicitly initializing it to signal that it is invalid, the only difference is that you can programmatically check if fd is invalid and refrain from calling close(fd), for example, with the latter, while with the former you cannot. > However, I didn't realize that I would initialize the strbuf later. > After waking up, I have suddenly realized this problem. Given that initialized-but-never-used strbuf does not hold any acquired resources, the current code at the end of the series is still OK. So there is technically nothing to fix. I'll take a reroll if you later send one, but as I said, I do not think it is necessary to reroll only to add fd=-1 initialization.