From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 2 16:53:40 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3490D16A4CE; Fri, 2 Jan 2004 16:53:40 -0800 (PST) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id E94E443D49; Fri, 2 Jan 2004 16:53:38 -0800 (PST) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id DB51C5C7AD; Fri, 2 Jan 2004 16:53:38 -0800 (PST) Date: Fri, 2 Jan 2004 16:53:38 -0800 From: Alfred Perlstein To: dg@freebsd.org Message-ID: <20040103005338.GU9623@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i cc: hackers@freebsd.org Subject: [PATCH] sendfile erroniously returns ENOTCONN. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jan 2004 00:53:40 -0000 sendfile(2) returns ENOTCONN when the remote side has disconnected instead of EPIPE. Can this fix be applied? Is there a reason for it being the way it is? I know EPIPE can cause SIGPIPE which can cause problems, but the error here is incorrect, and considering that the manpage mentions EPIPE as a possible error... is this perhaps due to a change in the socket flags API? I know the problem is on 4.x and 5.x. Index: uipc_syscalls.c =================================================================== RCS file: /home/ncvs/src/sys/kern/uipc_syscalls.c,v retrieving revision 1.162 diff -u -r1.162 uipc_syscalls.c --- uipc_syscalls.c 28 Dec 2003 08:57:08 -0000 1.162 +++ uipc_syscalls.c 2 Jan 2004 21:56:10 -0000 @@ -1697,10 +1697,6 @@ error = EINVAL; goto done; } - if ((so->so_state & SS_ISCONNECTED) == 0) { - error = ENOTCONN; - goto done; - } if (uap->offset < 0) { error = EINVAL; goto done; -- - Alfred Perlstein - Research Engineering Development Inc. - email: bright@mu.org cell: 408-480-4684