[RFC 4/6] Use mkostemp, not mkstemp

Simon Marchi simark@simark.ca
Sat Sep 29 03:09:00 GMT 2018


On 2018-09-26 7:11 a.m., Tom Tromey wrote:
> I noticed that gdb could leak file descriptors coming from mkstemp.
> This patch fixes the problem by importing the gnulib mkostemp instead,
> and then changing gdb to pass O_CLOEXEC.

While this looks like the correct thing to do, I am curious to know if
you encountered an actual issue or this is theoretical.  I don't see
how a fork/exec could happen while one of these temp files are open.

Simon



More information about the Gdb-patches mailing list