Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Apr 1998 01:05:16 +0200
From:      Martin Cracauer <cracauer@cons.org>
To:        Bruce Evans <bde@zeta.org.au>, cracauer@cons.org
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: make/SIGINT (Re: cvs commit: src/bin/sh jobs.c)
Message-ID:  <19980404010516.63824@cons.org>
In-Reply-To: <199803170406.PAA27158@godzilla.zeta.org.au>; from Bruce Evans on Tue, Mar 17, 1998 at 03:06:43PM %2B1100
References:  <199803170406.PAA27158@godzilla.zeta.org.au>

next in thread | previous in thread | raw e-mail | index | archive | help

--S0zKkzwUGydFO0od
Content-Type: text/plain; charset=us-ascii

In <199803170406.PAA27158@godzilla.zeta.org.au>, Bruce Evans wrote: 
> truss(1) has much the same problem as make(1).  ktrace(1) works right
> (not surprising - it doesn't fork).

The appended fix should fix truss. I treated SIGQUIT as you did for
make(1), but see my mail from two minutes ago - is that the right
thing? 

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

--S0zKkzwUGydFO0od
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff

diff -c -r usr.bin/truss/main.c usr.bin/truss.work/main.c
*** usr.bin/truss/main.c	Sat Feb  7 12:20:54 1998
--- usr.bin/truss.work/main.c	Sat Apr  4 00:53:53 1998
***************
*** 127,132 ****
--- 127,133 ----
    struct ex_types *funcs;
    int in_exec = 0;
    char *fname = NULL;
+   int sigexit = 0;
  
    while ((c = getopt(ac, av, "p:o:S")) != -1) {
      switch (c) {
***************
*** 216,221 ****
--- 217,223 ----
  	break;
        case S_SIG:
  	fprintf(outfile, "SIGNAL %d\n", pfs.val);
+ 	sigexit = pfs.val;
  	break;
        case S_EXIT:
  	fprintf (outfile, "process exit, rval = %d\n", pfs.val);
***************
*** 232,236 ****
--- 234,244 ----
      if (ioctl(Procfd, PIOCCONT, val) == -1)
        warn("PIOCCONT");
    } while (pfs.why != S_EXIT);
+   if (sigexit) {
+     if (sigexit == SIGQUIT)
+       exit(sigexit);
+     (void) signal(sigexit, SIG_DFL);
+     (void) kill(getpid(), sigexit);
+   }
    return 0;
  }

--S0zKkzwUGydFO0od--

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?19980404010516.63824>