Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Mar 1998 13:08:11 +0100
From:      Martin Cracauer <cracauer@cons.org>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        cracauer@cons.org, freebsd-current@FreeBSD.ORG
Subject:   make/SIGINT (Re: cvs commit: src/bin/sh jobs.c)
Message-ID:  <19980311130811.56794@cons.org>
In-Reply-To: <199802121713.EAA30328@godzilla.zeta.org.au>; from Bruce Evans on Fri, Feb 13, 1998 at 04:13:51AM %2B1100
References:  <199802121713.EAA30328@godzilla.zeta.org.au>

next in thread | previous in thread | raw e-mail | index | archive | help
In <199802121713.EAA30328@godzilla.zeta.org.au>, Bruce Evans wrote: 
> I've seen some problems with my version of the fix.  The serious ones
> (2-3) probably affect all versions.
> 
> 1) When `make' of a kernel is killed by ^C, the newline to clean up
>    the output is printed after the shell prompt appears, so it messes
>    up the output.  This problem doesn't occur if /bin/sh is bash-1.
>
> 2) Shell scripts with `make' commands in them are hard to kill.  This
>    problem still occurs if /bin/sh is bash-1.  It seems to be a bug in
>    `make'.  According to a draft of POSIX.2, `make' shall catch SIGINT,
>    SIGQUIT, SIGTERM and SIGHUP in order to clean up, but it shall resend
>    SIGINT, SIGTERM and SIGHUP (but not necessarily SIGQUIT) to itself in
>    order to exit with a signal status.  `make' doesn't do this (at least
>    in -current).  Gnu make does it.
> 
> 3) Recursive makes (e.g., of /usr/src) are very hard to kill.  This seems
>    to be caused by the same bug in `make'.

What about the appended fix for make? It seems to fix the problem for
the non-compat mode of make. As our make is in compat mode by default
even if -B is not given, people would have to use `make -j 1` for now
to test it.

What were the reasons to use compat mode by default, BTW? Anyone has
test cases that fail in new mode with just one job allowed?

I added a few make tests to the sh-testsuite regarding SIGINT handling,
as usual at
hub.freebsd.org:/home/cracauer/public_html/ or
http://www.freebsd.org/~cracauer/ in directory testsuite/makestuff/

Martin
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <cracauer@cons.org> http://www.cons.org/cracauer
  cracauer@wavehh.hanse.de (batched, preferred for large mails)
  Tel.: (daytime) +4940 41478712 Fax.: (daytime) +4940 41478715
  Tel.: (private) +4940 5221829 Fax.: (private) +4940 5228536
  Paper: (private) Waldstrasse 200, 22846 Norderstedt, Germany


diff -c make.original/job.c make.work/job.c
*** make.original/job.c	Tue Aug 26 12:06:38 1997
--- make.work/job.c	Wed Mar 11 12:49:52 1998
***************
*** 2904,2910 ****
  	}
      }
      (void) eunlink(tfile);
!     exit(signo);
  }
  
  /*
--- 2904,2918 ----
  	}
      }
      (void) eunlink(tfile);
! 
!     /*
!      * For some signals, we don't want a direct exit, but to
!      * let them resent to ourself, which is done by the calling
!      * Routine.
!      */
! 
!     if (signo != SIGINT && signo != SIGTERM && signo != SIGHUP)
!       exit(signo);
  }
  
  /*

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980311130811.56794>