svn commit: r229148 - stable/9/cddl/contrib/opensolaris/cmd/dtrace

Dimitry Andric dim at FreeBSD.org
Sat Dec 31 19:56:26 UTC 2011


Author: dim
Date: Sat Dec 31 19:56:25 2011
New Revision: 229148
URL: http://svn.freebsd.org/changeset/base/229148

Log:
  MFC r228598:
  
  In cddl/contrib/opensolaris/cmd/dtrace/dtrace.c, fix some obtuse
  snprintf tricks.

Modified:
  stable/9/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
Directory Properties:
  stable/9/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
==============================================================================
--- stable/9/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c	Sat Dec 31 19:55:19 2011	(r229147)
+++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c	Sat Dec 31 19:56:25 2011	(r229148)
@@ -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,


More information about the svn-src-stable-9 mailing list