Re: closing fd's ....




Hmm, looking through the code, there are going to be problems setting
FD_CLOEXEC on things.  How the heck do we get the fd for ICE connections
in a non broken way?  Or is all the ICE messaging done through X? Is there
any good way to get the fd for an X connection(I am sure there is, I think
gtk does it).

In any case, because of the large number of places mods may need to be
made(gnome-config, gnorba, panel, gmc, etc.), using the FD_CLOEXEC flag is
going to take a little more time than I had thought.  I forgot about all
the encapsulation of connections(I am quite tired so I am not thinking
straight):).  Also it isn't clear that gnome-config should set FD_CLOEXEC
on its fds anyway(Does it keep open fds?), maybe that should be left to
the application too :).

So here is what I have done:

I have removed the _with_fds functions.  

I have added _fds variants of all the gnome_execute_* functions which take
a flag that determines if the fds get closed or not.

The default behavior of gnome_execute_* is to close the fds.  This is
because most apps expect this anyway.  I agree with Elliot that this is
not UNIX like and possibly broken, but setting FD_CLOEXEC on all the fds
that need it is going to take some time and thought, and we shouldn't
break things for people in the meantime(We can fix bash, we can't fix the
files don't free space problem). Since people seem divided on what the
default behavior should be, I will let someone else change the default
behavior AFTER they set CLOEXEC on all fd's in at least the core gnome
apps that need it, and if they think the current default is broken. :)
Maybe I will do it myself after exams next week, who knows.

I will check all this stuff in as soon as it finishes compiling here and I
test it :)

Sorry for all the confusion, I got ahead of myself and didn't think about
how tough it would be to add the FD_CLOEXEC stuff in.

Manish Vachharajani               Some Haiku: A crash reduces
<mvachhar@vger.rutgers.edu>                   your expensive computer
                                              to a simple stone - Unknown



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]