From owner-taylor-uucp@gnu.ai.mit.edu Wed Apr 15 00:31:50 1992
Status: RO
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil nil nil nil nil nil nil nil nil nil nil nil "^From:" nil nil nil])
Received: from fuug.fi by dolphin.funet.fi with SMTP id AA06940
  (5.65c/IDA-1.4.3 for ojala); Wed, 15 Apr 1992 00:31:47 +0300
Received: from churchy.gnu.ai.mit.edu by fuug.fi with SMTP id AA18758
  (5.65c/IDA-1.4.4 for <taylor-uucp-list@fuug.fi>); Wed, 15 Apr 1992 00:29:06 +0300
Received: by churchy.gnu.ai.mit.edu (5.65/4.0)
	id <AA08587@churchy.gnu.ai.mit.edu>; Tue, 14 Apr 92 16:55:25 -0400
Received: from relay1.UU.NET by churchy.gnu.ai.mit.edu (5.65/4.0) with SMTP
	id <AA08582@churchy.gnu.ai.mit.edu>; Tue, 14 Apr 92 16:55:20 -0400
Received: from uunet.uu.net (via LOCALHOST.UU.NET) by relay1.UU.NET with SMTP 
	(5.61/UUNET-internet-primary) id AA15906; Tue, 14 Apr 92 16:55:18 -0400
Received: from airs.UUCP by uunet.uu.net with UUCP/RMAIL
	(queueing-rmail) id 165415.29082; Tue, 14 Apr 1992 16:54:15 EDT
Received: by comton.airs.com (5.57/AIRS1.0)
	id AA16550; Tue, 14 Apr 92 16:14:51 -0400
Message-Id: <9204142014.AA16550@comton.airs.com>
In-Reply-To: <199204141850.AA18584@fidata.fi>; from "Petri Helenius" at Apr 14, 92 8:50 pm
X-Mailer: ELM [version 2.3 PL11]
From: ian@airs.com (Ian Lance Taylor)
To: pete@fidata.fi (Petri Helenius)
Cc: taylor-uucp@gnu.ai.mit.edu
Subject: Re: SERIOUS PROBLEM
Date: Tue, 14 Apr 92 16:14:50 -0400

> It seems that when uucico is called by /usr/lib/uucp/uucico -r1 -sfuug -f
> for example. It locks the LCK..fuug file with DIFFERENT (previous)
> pid than the tty.

As far as I can tell, this can only happen when the first attempt to
place a call fails, and an alternate is being used.  Sorry about that,
and please let me know if this was NOT the case when it happened to
you.  Here is an (unofficial) patch that should fix the problem.

*** 1.93	1992/04/14 19:03:17
--- uucico.c	1992/04/14 20:10:35
***************
*** 607,614 ****
  	      fLocked_system = TRUE;
  	      fret = fcall (&sLocked_system, qport, fforce, BGRADE_HIGH,
  			    fnodetach);
! 	      (void) fsysdep_unlock_system (&sLocked_system);
! 	      fLocked_system = FALSE;
  	    }
  
  #if DEBUG > 1
--- 607,617 ----
  	      fLocked_system = TRUE;
  	      fret = fcall (&sLocked_system, qport, fforce, BGRADE_HIGH,
  			    fnodetach);
! 	      if (fLocked_system)
! 		{
! 		  (void) fsysdep_unlock_system (&sLocked_system);
! 		  fLocked_system = FALSE;
! 		}
  	    }
  
  #if DEBUG > 1
***************
*** 665,672 ****
  		      /* Now ignore any SIGHUP that we got.  */
  		      afSignal[INDEXSIG_SIGHUP] = FALSE;
  
! 		      (void) fsysdep_unlock_system (&pas[i]);
! 		      fLocked_system = FALSE;
  		    }
  
  #if DEBUG > 1
--- 668,678 ----
  		      /* Now ignore any SIGHUP that we got.  */
  		      afSignal[INDEXSIG_SIGHUP] = FALSE;
  
! 		      if (fLocked_system)
! 			{
! 			  (void) fsysdep_unlock_system (&pas[i]);
! 			  fLocked_system = FALSE;
! 			}
  		    }
  
  #if DEBUG > 1
***************
*** 956,964 ****
  		return FALSE;
  
  	      /* Now we have to dump that port so that we can aquire a
! 		 new one.  */
  	      if (! fnodetach)
! 		usysdep_detach ();
  	    }
  	}
  
--- 962,979 ----
  		return FALSE;
  
  	      /* Now we have to dump that port so that we can aquire a
! 		 new one.  On Unix this means that we will fork and
! 		 get a new process ID, so we must unlock and relock
! 		 the system.  */
  	      if (! fnodetach)
! 		{
! 		  (void) fsysdep_unlock_system (&sLocked_system);
! 		  fLocked_system = FALSE;
! 		  usysdep_detach ();
! 		  if (! fsysdep_lock_system (&sLocked_system))
! 		    return FALSE;
! 		  fLocked_system = TRUE;
! 		}
  	    }
  	}
  
-- 
Ian Taylor                     ian@airs.com                    uunet!airs!ian
First person to identify this quote wins a free e-mail message:
``Do you make a grievance of weighing so many pounds only, instead of three
  hundred?  Then why fret about living so many years only, instead of more?''

