Re: [patch gdbserver 7.6.1 only] Fix fd leak regression

Pedro Alves
2013-08-29T12:15:51Z

On 08/29/2013 12:10 PM, Jan Kratochvil wrote:
> Hi,
>
> in
> [commit without 7.6.1] [gdbserver patch] [7.6.1] Fix fd leak regression
> https://sourceware.org/ml/gdb-patches/2013-08/msg00845.html
> I wrote:
> # Although without 7.6.1 - 7.6 does not yet have gdb/common/filestuff.[ch] and
> # from various available solutions I think it is just OK to wait for 7.7.
>
> As I found I would like even 7.6.x fixed I wrote this alternative patch.
>

(We could also just mark the sockets as SOCK_CLOEXEC, I think?
Though that's "only" since Linux 2.6.27, so I've no objection with
going this route.)

I think we need to close remote_desc too. With plain "target remote",
the inferior is spawned before gdb connects, but with extended-remote+"run",
that's not the case.

--
Pedro Alves