ok, I found why I have some 'null' descriptors... it nears the same case that
with 'tty' descriptors.
I have a custom script (again) for X11 locking, that first destroy kerberos
tickets. And I use "tmux show-environment" for get KRB5CCNAME environment
variable that I used in the tmux session.
As the script is run by cwm, the input descriptor should be /dev/null.
The patch resolvs all the problem.
For simple test, this command could be used:
$ tmux info < /dev/null
This will dup the descriptor in the tmux server, and it will not close it. So
after some time, too many descriptors are opened...
Thanks again.
--
Sebastien Marie
On Wed, Sep 26, 2012 at 05:19:56PM +0200, Sébastien Marie wrote:
> The patch seems to resolv the problem.
>
> Only seems, because I only known to reproduce it for the 'tty' descriptor,
> but I hope the 'null' descriptor will be in the same case :-)
>
> But I will use this version for test it.
>
> Thanks a lot.
> --
> Sebastien Marie
>
> On Wed, Sep 26, 2012 at 03:42:23PM +0100, Nicholas Marriott wrote:
> > Try this please:
> >
> > Index: server-client.c
> > ===================================================================
> > RCS file: /cvs/src/usr.bin/tmux/server-client.c,v
> > retrieving revision 1.79
> > diff -u -p -r1.79 server-client.c
> > --- server-client.c 3 Sep 2012 09:32:38 -0000 1.79
> > +++ server-client.c 26 Sep 2012 14:42:04 -0000
> > @@ -912,8 +912,10 @@ server_client_msg_identify(
> > return;
> > }
> >
> > - if (!isatty(fd))
> > - return;
> > + if (!isatty(fd)) {
> > + close(fd);
> > + return;
> > + }
> > data->term[(sizeof data->term) - 1] = '\0';
> > tty_init(&c->tty, c, fd, data->term);
> > if (data->flags & IDENTIFY_UTF8)