From owner-svn-src-head@FreeBSD.ORG Sun Jan 27 03:17:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0878A7CB; Sun, 27 Jan 2013 03:17:36 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EE4A7CF5; Sun, 27 Jan 2013 03:17:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0R3HZKK062651; Sun, 27 Jan 2013 03:17:35 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0R3HZcE062650; Sun, 27 Jan 2013 03:17:35 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201301270317.r0R3HZcE062650@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 27 Jan 2013 03:17:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245957 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 03:17:36 -0000 Author: mjg Date: Sun Jan 27 03:17:35 2013 New Revision: 245957 URL: http://svnweb.freebsd.org/changeset/base/245957 Log: truss: use 'e' flag for fopen instead of fcntl(.., FD_CLOEXEC) Modified: head/usr.bin/truss/main.c Modified: head/usr.bin/truss/main.c ============================================================================== --- head/usr.bin/truss/main.c Sun Jan 27 03:14:54 2013 (r245956) +++ head/usr.bin/truss/main.c Sun Jan 27 03:17:35 2013 (r245957) @@ -234,15 +234,12 @@ main(int ac, char **av) usage(); if (fname != NULL) { /* Use output file */ - if ((trussinfo->outfile = fopen(fname, "w")) == NULL) - err(1, "cannot open %s", fname); /* - * Set FD_CLOEXEC, so that the output file is not shared with - * the traced process. + * Set close-on-exec ('e'), so that the output file is not + * shared with the traced process. */ - if (fcntl(fileno(trussinfo->outfile), F_SETFD, FD_CLOEXEC) == - -1) - warn("fcntl()"); + if ((trussinfo->outfile = fopen(fname, "we")) == NULL) + err(1, "cannot open %s", fname); } /*