From owner-svn-src-all@freebsd.org Sat Aug 29 07:23:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DAD29C4524; Sat, 29 Aug 2015 07:23:43 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x234.google.com (mail-pa0-x234.google.com [IPv6:2607:f8b0:400e:c03::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B15B1E57; Sat, 29 Aug 2015 07:23:43 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by pabzx8 with SMTP id zx8so85079199pab.1; Sat, 29 Aug 2015 00:23:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=D3TLtfMS/+xdyQOOBKG69TmuyTC5ldPP378aouIp+Nk=; b=nanSvVJMa4SIa5PcEhdw2+LHt5M7EgQ6ePQcRJQY5Lps22kI0GhRF+vjOszqmBceps 0Y6zkWcBVUZ7gKWnz7ZoV6opK30sX1D+nwwba8ZjnCwrJMXrm5dfUfkeVWgex1n0ZNOA 0xAKt3ySfiEIu2dYWlcWAwWtFlHHSPksqCCmi9/TqnqwzquvHO/lFWz0OqO/pdSf88O0 4WocP/gdfDVC5haRM70obWIjGAxbUKUM818jqBfB0PPETvPJ3HzqzFRZfuPvF9oP82HR WBhsdDsF2ifCjZVNJKYv3ttNJlnhrvk+gSHyH1/4y/k7kbDRr+VFJvDao73UI6EwFmD2 RHRg== X-Received: by 10.66.217.138 with SMTP id oy10mr21481519pac.83.1440833022799; Sat, 29 Aug 2015 00:23:42 -0700 (PDT) Received: from ?IPv6:2601:601:800:126d:d9d:ae1d:4add:6080? ([2601:601:800:126d:d9d:ae1d:4add:6080]) by smtp.gmail.com with ESMTPSA id hg3sm2673786pbc.45.2015.08.29.00.23.41 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 29 Aug 2015 00:23:42 -0700 (PDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r287236 - head/bin/df From: Garrett Cooper In-Reply-To: <55E0859A.50504@freebsd.org> Date: Sat, 29 Aug 2015 00:23:41 -0700 Cc: "O'Connor, Daniel" , Alexey Dokuchaev , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Xin LI Content-Transfer-Encoding: quoted-printable Message-Id: References: <201508280044.t7S0ixfW038766@repo.freebsd.org> <20150828044312.GA88538@FreeBSD.org> <20150828060458.GA20642@FreeBSD.org> <55E0859A.50504@freebsd.org> To: Allan Jude X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 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: Sat, 29 Aug 2015 07:23:43 -0000 > On Aug 28, 2015, at 09:00, Allan Jude wrote: =85 >> Libxo (iirc) doesn't install atexit handlers, which means that you = need to use exit (or a reason facsimile) in order for it to flush its = file streams. >>=20 >> This is unintuitive though. I wish it did the right thing as part of = initializing the streams.. >=20 > This has nothing to do with libxo. libxo has an optional atexit = handler, > but as long as you call xo_finish(), then everything is flushed and = the > xo handle is closed. xo_finish() is indeed called the line before this > change. (Just wanted to clarify/correct what I said earlier :)..) Yes. Some of the details I was remembering were a bit correct from = dealing with the bugs with usr.bin/w, but I was also blurred/said some = incorrect things (as others have pointed out): - As you said, there=92s an optional atexit handler in libxo = (xo_finish_atexit). - xo_finish_atexit and xo_finish both call xo_finish_h with the NULL on = r287124. - xo_finish_h writes out data, flushes its streams via xo_flush_h, then = closes them out. exit definitely flushes file descriptors, but it doesn=92t do everything = that xo_finish does (for obvious reasons). This is where the statement I = made was incorrect. As Warner said later on, exit flushes file = descriptors (along with _exit/_Exit, with caveats noted in the POSIX = spec: = http://pubs.opengroup.org/onlinepubs/9699919799/functions/_exit.html ). Thanks :), -NGie=