Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 4320 invoked from network); 2 Nov 2007 18:44:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Nov 2007 18:44:36 -0000 Received: (qmail 6399 invoked by uid 500); 2 Nov 2007 18:44:23 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 6348 invoked by uid 500); 2 Nov 2007 18:44:23 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 6337 invoked by uid 99); 2 Nov 2007 18:44:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Nov 2007 11:44:23 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of slowhog@gmail.com designates 209.85.198.187 as permitted sender) Received: from [209.85.198.187] (HELO rv-out-0910.google.com) (209.85.198.187) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Nov 2007 18:44:25 +0000 Received: by rv-out-0910.google.com with SMTP id l15so721848rvb for ; Fri, 02 Nov 2007 11:44:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:content-type:sender; bh=7kvXU3MB0rCH02405yJbXtzsIMjW+A95+YpIXTsn/2c=; b=bewQ+ZcOJydj/HSSOPSHoyEWC8qkmb+RQl8W/tsPKvtqoLqSYuYihrQkwWFatCfxczsj/KPfe5xbmp1kYToGl4GfUO/9AgxtoNfXlSeXecYX3vodRR8LLev1Ei1FsisdUBfwbF7o00nfWsf1b/xy5Feq+4qR1YaYlbxoMWtxXPM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:subject:content-type:sender; b=ZK8Sp46zEa+u7D26A32zwmXAv2EU+Bcev9JkHi3ZpDGMwmCa7pieYgE/eYElmtfPji6P/GA41LKo0IA7FZ1+n53TP3nAoxgXWIWWh3bHusOTBaMIypYzaksdK4mOyVsBhrLu6X3Sy3AhVxBPOa0DJ+TVezINVoU2fXGZz/5X0kM= Received: by 10.140.203.9 with SMTP id a9mr1055494rvg.1194029044121; Fri, 02 Nov 2007 11:44:04 -0700 (PDT) Received: from ?192.168.123.103? ( [71.202.141.87]) by mx.google.com with ESMTPS id l38sm5890685rvb.2007.11.02.11.44.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 02 Nov 2007 11:44:02 -0700 (PDT) Message-ID: <472B7003.5050105@ztune.net> Date: Fri, 02 Nov 2007 11:44:19 -0700 From: Henry Jen User-Agent: Thunderbird 2.0.0.4 (X11/20070814) MIME-Version: 1.0 To: APR Development List Subject: [PATCH] apr_poll[set|cb]_remove should returns APR_SUCCESS instead of APR_NOTFOUND with testpoll Content-Type: multipart/mixed; boundary="------------040003040700060800010809" Sender: Henry Jen X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. --------------040003040700060800010809 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, Attached is a fix for the poll implementation on Solaris using port. The issue is that when calling port_dissociate with a file descriptor has not been associated, port_dissociate will return -1 and set errno to ENOENT. The apr_pollcb_poll should also re-associate the fd with port. Per the man page for port_dissociate: > The port_dissociate() function will fail if: > > EACCES The process is not the owner of the association. > > > ENOENT The specified object is not associated with the > port. Cheers, Henry --------------040003040700060800010809 Content-Type: text/x-patch; name="solaris_poll_remove.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="solaris_poll_remove.diff" Index: poll/unix/port.c =================================================================== --- poll/unix/port.c (revision 591399) +++ poll/unix/port.c (working copy) @@ -192,6 +192,7 @@ pfd_elem_t *ep; apr_status_t rv = APR_SUCCESS; int res; + int err; pollset_lock_rings(); @@ -205,6 +206,7 @@ res = port_dissociate(pollset->port_fd, PORT_SOURCE_FD, fd); if (res < 0) { + err = errno; rv = APR_NOTFOUND; } @@ -233,6 +235,9 @@ APR_RING_REMOVE(ep, link); APR_RING_INSERT_TAIL(&(pollset->dead_ring), ep, pfd_elem_t, link); + if (ENOENT == err) { + rv = APR_SUCCESS; + } break; } } @@ -464,6 +469,7 @@ if (rv) { return rv; } + rv = apr_pollcb_add(pollcb, pollfd); } } --------------040003040700060800010809--