From owner-freebsd-current@FreeBSD.ORG Mon Jun 16 07:40:37 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2B2B437B401 for ; Mon, 16 Jun 2003 07:40:37 -0700 (PDT) Received: from bbnest.dyndns.org (i013183.ap.plala.or.jp [218.47.13.183]) by mx1.FreeBSD.org (Postfix) with ESMTP id E71D143FBD for ; Mon, 16 Jun 2003 07:40:35 -0700 (PDT) (envelope-from bland@mail.ru) Received: from mail.ru (bland@localhost [127.0.0.1]) by bbnest.dyndns.org (8.12.9/8.12.9) with ESMTP id h5GEeYsD018975 for ; Mon, 16 Jun 2003 23:40:34 +0900 (JST) (envelope-from bland@mail.ru) Message-ID: <3EEDD6E2.6040505@mail.ru> Date: Mon, 16 Jun 2003 23:40:34 +0900 From: Alexander Nedotsukov User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3.1) Gecko/20030512 X-Accept-Language: en-us, en MIME-Version: 1.0 To: current@freebsd.org Content-Type: multipart/mixed; boundary="------------090702080803070800000203" Subject: truss issue X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jun 2003 14:40:37 -0000 This is a multi-part message in MIME format. --------------090702080803070800000203 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit All, I found current truss behaviour a bit strange. It coredumps always if trussed process do without any significant reason for my understanding. I also confused with comment for commit originally introduced this functionality http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.bin/truss/main.c.diff?r1=1.9&r2=1.10. I propose patch attached to make truss always return result of trussed process and do not kill() itself. What do you think about it? All the best, Alexander. --------------090702080803070800000203 Content-Type: text/plain; name="truss.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="truss.patch" --- usr.bin/truss/main.c.orig Mon Jun 16 23:00:35 2003 +++ usr.bin/truss/main.c Mon Jun 16 23:05:03 2003 @@ -144,7 +144,7 @@ struct ex_types *funcs; int in_exec = 0; char *fname = NULL; - int sigexit = 0; + int rval = 0; struct trussinfo *trussinfo; /* Initialize the trussinfo struct */ @@ -283,10 +283,10 @@ break; case S_SIG: fprintf(trussinfo->outfile, "SIGNAL %lu\n", pfs.val); - sigexit = pfs.val; break; case S_EXIT: fprintf (trussinfo->outfile, "process exit, rval = %lu\n", pfs.val); + rval = pfs.val; break; case S_EXEC: funcs = set_etype(trussinfo); @@ -305,11 +305,5 @@ } } while (pfs.why != S_EXIT); fflush(trussinfo->outfile); - if (sigexit) { - if (sigexit == SIGQUIT) - exit(sigexit); - (void) signal(sigexit, SIG_DFL); - (void) kill(getpid(), sigexit); - } - return 0; + return rval; } --------------090702080803070800000203--