Am 13.11.2009 16:41, schrieb Nathan Froyd:
> On Fri, Nov 13, 2009 at 04:17:16PM +0100, Kevin Wolf wrote:
>> We're leaking file descriptors to child processes. Set FD_CLOEXEC on file
>> descriptors that don't need to be passed to children to stop this
>> misbehaviour.
>>
>>> --- a/gdbstub.c
>> +++ b/gdbstub.c
>> @@ -2356,6 +2356,9 @@ static void gdb_accept(void)
>> perror("accept");
>> return;
>> } else if (fd >= 0) {
>> +#ifndef _WIN32
>> + fcntl(fd, F_SETFD, FD_CLOEXEC);
>> +#endif
>> break;
>> }
>> }
>
> Why not just use the new accept wrapper here?
gdbstub.c is also used in the Linux userspace emulator where the accept
wrapper is not available. I tried to add osdep.c to the linux-user build
- after all, it looked easy enough - but it ended up being too much
Makefile magic. This is why I decided to go for the easy way and expand it.
Kevin