From owner-svn-src-head@freebsd.org Mon Sep 30 21:53:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B68A513321C; Mon, 30 Sep 2019 21:53:26 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hx3p4Nyxz4Tl2; Mon, 30 Sep 2019 21:53:26 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79F4992D6; Mon, 30 Sep 2019 21:53:26 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8ULrQlt031851; Mon, 30 Sep 2019 21:53:26 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8ULrQoO031850; Mon, 30 Sep 2019 21:53:26 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201909302153.x8ULrQoO031850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 30 Sep 2019 21:53:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352921 - head/bin/dd X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/bin/dd X-SVN-Commit-Revision: 352921 X-SVN-Commit-Repository: base 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.29 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: Mon, 30 Sep 2019 21:53:26 -0000 Author: mmacy Date: Mon Sep 30 21:53:26 2019 New Revision: 352921 URL: https://svnweb.freebsd.org/changeset/base/352921 Log: dd: Check result of close(2) for errors close(2) can return errors from previous operations which should not be ignored. PR: 229616 Submitted by: Thomas Hurst Reported by: Thomas Hurst Reviewed by: mmacy@ Obtained from: Ryan Moeller MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21376 Modified: head/bin/dd/dd.c Modified: head/bin/dd/dd.c ============================================================================== --- head/bin/dd/dd.c Mon Sep 30 21:48:12 2019 (r352920) +++ head/bin/dd/dd.c Mon Sep 30 21:53:26 2019 (r352921) @@ -124,7 +124,8 @@ main(int argc __unused, char *argv[]) * descriptor explicitly so that the summary handler (called * from an atexit() hook) includes this work. */ - close(out.fd); + if (close(out.fd) == -1 && errno != EINTR) + err(1, "close"); exit(0); }