Re: hardcoded /tmp instead of TMPDIR



Hello!

Replying to myself :-)

> You forgot some debugging statements in the patch.  Also, it seems that
> you are calculating tmpdir both in the child and in the parent processes.  
> Why?  Whould not it be better to calculate it once?  I also think that the
> name of the pipe should be calculated once.

I have applied my patch, which takes a different approach.  The temporary
directory is calculated once (ideally - once for the whole mc).  The tsch
pipe name is also calculated once.  tcsh works, the pipe is properly 
removed on exit.

> I still hope to avoid the pipe completely, since it's not portable to
> Cygwin.

Not so easy.  It I run "tcsh 3>log", /proc shows that the open file
descriptors are 15, 16, 17, 18 and 19.  The same if I run "tcsh".  In
other words, tcsh closes the files it inherits from the parent process.  
Which leaves us with pipes, UNIX sockets, SysV IPC, TCP/IP and other
things, of which the pipes are still the simplest solution.  TCP/IP may be 
more portable, but it would be a huge overkill.

-- 
Regards,
Pavel Roskin




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