From owner-svn-src-all@FreeBSD.ORG Fri Dec 16 21:48:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E4BC106566C; Fri, 16 Dec 2011 21:48:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D13B8FC1A; Fri, 16 Dec 2011 21:48:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pBGLm969028232; Fri, 16 Dec 2011 21:48:09 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBGLm9V3028230; Fri, 16 Dec 2011 21:48:09 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201112162148.pBGLm9V3028230@svn.freebsd.org> From: Dimitry Andric Date: Fri, 16 Dec 2011 21:48:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228598 - head/cddl/contrib/opensolaris/cmd/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Dec 2011 21:48:10 -0000 Author: dim Date: Fri Dec 16 21:48:09 2011 New Revision: 228598 URL: http://svn.freebsd.org/changeset/base/228598 Log: In cddl/contrib/opensolaris/cmd/dtrace/dtrace.c, fix some obtuse snprintf tricks. MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Fri Dec 16 21:29:46 2011 (r228597) +++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Fri Dec 16 21:48:09 2011 (r228598) @@ -671,9 +671,12 @@ link_prog(dtrace_cmd_t *dcp) p[0] = '\0'; /* strip .d suffix */ (void) snprintf(dcp->dc_ofile, sizeof (dcp->dc_ofile), "%s.o", basename(dcp->dc_arg)); + } else if (g_cmdc > 1) { + (void) snprintf(dcp->dc_ofile, sizeof (dcp->dc_ofile), + "d.out.%td", dcp - g_cmdv); } else { (void) snprintf(dcp->dc_ofile, sizeof (dcp->dc_ofile), - g_cmdc > 1 ? "%s.%d" : "%s", "d.out", (int)(dcp - g_cmdv)); + "d.out"); } if (dtrace_program_link(g_dtp, dcp->dc_prog, DTRACE_D_PROBES,