From root Sat Jul 18 10:21:36 1992
To: erc
>From gnu.ai.mit.edu!owner-taylor-uucp  Sat Jul 18 10:17:14 1992 remote from saturn
Received: from uplherc.upl.com by saturn.upl.com (4.1/SMI-4.1)
	id AA12062; Sat, 18 Jul 92 10:17:14 MDT
Received: from apple.com by uplherc.upl.com (4.1/SMI-4.1)
	id AA28319; Sat, 18 Jul 92 10:17:11 MDT
Received: from churchy.gnu.ai.mit.edu by apple.com with SMTP (5.61/10-Dec-1991-eef)
	id AA07591; Sat, 18 Jul 92 09:17:07 -0700
	for unislc!erc@saturn.upl.com
Received: by churchy.gnu.ai.mit.edu (5.65/4.0)
	id <AA28500@churchy.gnu.ai.mit.edu>; Sat, 18 Jul 92 12:07:31 -0400
Received: from relay2.UU.NET by churchy.gnu.ai.mit.edu (5.65/4.0) with SMTP
	id <AA28496@churchy.gnu.ai.mit.edu>; Sat, 18 Jul 92 12:07:29 -0400
Received: from uunet.uu.net (via LOCALHOST.UU.NET) by relay2.UU.NET with SMTP 
	(5.61/UUNET-internet-primary) id AA17922; Sat, 18 Jul 92 12:07:32 -0400
Received: from airs.UUCP by uunet.uu.net with UUCP/RMAIL
	(queueing-rmail) id 120257.5941; Sat, 18 Jul 1992 12:02:57 EDT
From: saturn!airs.com!ian (Ian Lance Taylor)
Received: by comton.airs.com (5.57/AIRS1.0)
	id AA20514; Sat, 18 Jul 92 11:22:51 -0400
Message-Id: <9207181522.AA20514@comton.airs.com>
Subject: Re: uucico hangs when line BUSY, or dies
To: apple.com!erc
Date: Sat, 18 Jul 92 11:22:49 -0400
Cc: gnu.ai.mit.edu!taylor-uucp
In-Reply-To: <9207180556.AA11711@saturn.upl.com>; from "Ed Carp" at Jul 17, 92 11:54 pm
X-Mailer: ELM [version 2.3 PL11]
Status: RO

> I've also noticed that uucico will hang if the line is busy - it never
> times out :(

The code assumes that a signal handler installed by using sigaction
will interrupt a slow system call.  If it does not, the code will
never timeout.  Is this true on Linux?  On SunOS, the SA_INTERRUPT
flag is required to make this work.  I have included the simple patch
required for SunOS (I've sent it out before, but it's very small).

If there is no way to force a signal to interrupt a slow system call,
you will have to change sysh.unx to force HAVE_RESTARTABLE_SYSCALLS to
1 (normally, if HAVE_SIGACTION is 1, HAVE_RESTARTABLE_SYSCALLS will be
set to 0).  Please let me know if this is the case.

> Also, I don't remember if I've mentioned this one before, but uucico
> has this annoying habit of logging that it's calling a system, creates
> the LCK files, then dies. :(

I've seen this from at least one other person.  If it's dying without
a log message and leaving the LCK file, I think (I hope) it must be
receiving some signal it doesn't handle.  I assume it's not leaving a
core dump (it would be in the spool directory).  Perhaps you could
wrap uucico in a shell script, and save the exit status somewhere?
That might at least indicate what signal it was receiving.

Here is the SA_INTERRUPT patch.

*** code/uucp-archive/uucp-1.03/sys1.unx	Tue Apr  7 01:05:27 1992
--- sys1.unx	Tue Jun 16 17:07:04 1992
***************
*** 973,979 ****
--- 973,983 ----
  
    s.sa_handler = pfn;
    sigemptyset (&s.sa_mask);
+ #ifdef SA_INTERRUPT
+   s.sa_flags = SA_INTERRUPT;
+ #else
    s.sa_flags = 0;
+ #endif
  
    if (sigaction (isig, &s, (struct sigaction *) NULL) != 0)
      ulog (LOG_FATAL, "sigaction (%d): %s", isig, strerror (errno));

-- 
Ian Taylor | ian@airs.com | First to identify quote wins free e-mail message:
``It takes a man months and months to reconcile himself to a new hat.  And
  just when you're preparing to send it to the jumble sale, he says, `That's
  rather a nice hat you've got on, where did you get it?' ''

