[gnu.emacs.bug] Problem in callproc.c

rde%topexpress.co.uk@NSS.CS.UCL.AC.UK (Richard Evans) (02/16/89)

GNU Emacs version 18.49, Sun-3 implementation
---------------------------------------------

There is a minor problem in 'call-process' in callproc.c.  If the BUFFER 
parameter is zero, /dev/null is opened as follows:

  if (XTYPE (buffer) == Lisp_Int)
#ifdef VMS
    fd[1] = open ("NLA0:", 0), fd[0] = -1;
#else
    fd[1] = open ("/dev/null", 0), fd[0] = -1;
#endif /* not VMS */

ON the Sun (OS releases 3.5 and 4.0), zero flags means read only and the
process will get an error if is tries to write to the descriptor.  I noticed
this because I got a 'bad file number' report in a mail message returned due
to a bad address (ie. a sendmail error).

Changing the zero to O_RDWR (or O_WRONLY, I guess) fixes this problem.