🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #1606

Re: Emacs hangs when run under /bin/sh

#1606
From: The Demented Teddy Bear
Date: Tue, 18 Apr 1989 06:44
42 lines
1908 bytes
In article <8904051856.AA17243@swiss-mocha.MIT.EDU> rajeev@SWISS-MOCHA.MIT.EDU (Rajeev Jayavant) writes:
> We are running GNU Emacs version 18.53 under SunOS 4.0 on a Sun 3/280
> system.[...]  The problem is that emacs hangs indefinitely when it is
> run...

I just finished fighting with the exact same problem (down to the hardware
even).  I found that emacs would start fine from the shell (/bin/csh in
this case), but locked up when fired off by something like vipw, mail,
ingres, etc.  Here's a fix that works, but is far from elegant:

in emacs.c:
================================================================
# if defined (NMTHACK)
  {
    int pgrp;

    ioctl (fileno (stdin), TIOCGPGRP, &pgrp);
    if (getpid () != pgrp)
    {
	setpgrp (pgrp, pgrp);
    }
    else
    {
	ioctl (fileno (stdin), TIOCSPGRP, &pgrp);
    }
  }
# else
#ifdef BSD
  /* interrupt_input has trouble if we aren't in a separate process group.  */
  setpgrp (getpid (), getpid ());
#endif
# endif
================================================================
Note that I also moved the whole thing below the handling for ``-t'',
on the off-chance that file descriptors were getting hosed.  I haven't
checked yet, but I think the second ioctl is redundant.  Works for me....

Dieter
-- 
Welcome to the island.  You are number six.
dieter%nmt@relay.cs.net
dieter@jupiter.nmt.edu
Technical Details
Message-ID: <2327@jupiter.nmt.edu>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ucsd!jupiter!dieter
References: <8904051856.AA17243@swiss-mocha.MIT.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ucsd!jupiter!dieter
From: dieter@jupiter.nmt.edu (The Demented Teddy Bear)
Newsgroups: gnu.emacs.bug
Subject: Re: Emacs hangs when run under /bin/sh
Message-ID: <2327@jupiter.nmt.edu>
Date: 18 Apr 89 06:44:31 GMT
References: <8904051856.AA17243@swiss-mocha.MIT.EDU>
Reply-To: dieter@nmtsun.nmt.edu (The Demented Teddy Bear)
Distribution: gnu
Organization: New Mexico Tech, Socorro NM
Lines: 42