[PATCH] Cygwin: console: Fix clean up conditions in close()

Takashi Yano takashi.yano@nifty.ne.jp
Mon Nov 11 09:14:06 GMT 2024


On Fri, 8 Nov 2024 18:26:47 -0700
Brian Inglis wrote:

> It might be better if you could please document the wrong premise, as well as 
> the right premise, and the reason for choosing the latter over the former, as in 
> your other console patches?

Yeah, you are right. I was cutting corner at that moment.
The wrong premis was that I thought myself->cygstarted is
true for process which start in shell by exec command.
Actually, the process inherits the myself->cygstartd from
the shell.

New code dtermines how many handles exist by checking the
current process is console owner process which started
cons_master_thread.

The commit message cannot be revised, so, I'd like to
add comment to source code as well as the explanation
for following magic number 2 and 3.

> In the comparison vs handle count, the reason for hard coding those magic 
> numbers would perhaps be better expressed by defining meaningful symbolic names 
> for those numbers, maybe also a named macro for picking the magic number to use, 
> and some explanation of what those numbers, comparisons, and settings represent.

Thanks!

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>


More information about the Cygwin-patches mailing list