Received: by mail.netbsd.org (Postfix, from userid 605) id DE22A14A48B; Sun, 5 Aug 2012 04:26:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id DEEF214A448 for ; Sun, 5 Aug 2012 04:26:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at NetBSD.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.NetBSD.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id ivmMm0NmWBd4 for ; Sun, 5 Aug 2012 04:26:11 +0000 (UTC) Received: from cvs.netbsd.org (cvs.NetBSD.org [IPv6:2001:4f8:3:7:2e0:81ff:fe30:95bd]) by mail.netbsd.org (Postfix) with ESMTP id 1CADA14A421 for ; Sun, 5 Aug 2012 04:26:11 +0000 (UTC) Received: by cvs.netbsd.org (Postfix, from userid 500) id 0A935175DD; Sun, 5 Aug 2012 04:26:11 +0000 (UTC) MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Date: Sun, 5 Aug 2012 04:26:10 +0000 From: "Taylor R Campbell" Subject: CVS commit: src/sys/kern To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20120805042611.0A935175DD@cvs.netbsd.org> Sender: source-changes-owner@NetBSD.org List-Id: source-changes.NetBSD.org Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Taylor R Campbell" Mail-Followup-To: source-changes-d@NetBSD.org Module Name: src Committed By: riastradh Date: Sun Aug 5 04:26:10 UTC 2012 Modified Files: src/sys/kern: sys_descrip.c Log Message: Force sys_close not to restart by returning ERESTART. Print a diagnostic message if we ever get ERESTART out of fd_close and convert it to EINTR instead. Even if fd_close fails, it has already closed the file descriptor, so restarting the system call is a mistake, with dangerous consequences for multithreaded programs. Should probably turn the message into a kassert eventually, and maybe add one deeper in fd_close in order to more easily debug it before all the data structures are destroyed. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/kern/sys_descrip.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.