[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: poll() emulation in git/gnulib
From: |
Paolo Bonzini |
Subject: |
Re: poll() emulation in git/gnulib |
Date: |
Fri, 07 Sep 2012 16:46:31 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 |
Il 07/09/2012 12:58, Joachim Schmitz ha scritto:
>> From: Paolo Bonzini [mailto:address@hidden On Behalf Of Paolo Bonzini
>> Sent: Friday, September 07, 2012 11:41 AM
>> To: Joachim Schmitz
>> Cc: address@hidden; 'Junio C Hamano'; 'Erik Faye-Lund'; address@hidden;
>> address@hidden
>> Subject: Re: poll() emulation in git
>>
>> Il 07/09/2012 09:39, Joachim Schmitz ha scritto:
>>>>> I suppose it works to always handle ENOTSOCK that way, even on
>>>>> non-__TANDEM systems.
>>> Will you be fixing this in gnulib? How?
>>
>> I don't have access to the system, so it's best if you post the patches
>> yourself to bug-gnulib and git mailing lists (separately, since the code
>> is cross-pollinated but forked).
>
> Here's the patch hat fixed the problems for me.
> Whether or not to keep the #ifdef __TANDEM and/or to enable the commented
> additional check, to make it usable for non HP NonStop I
> don't know...
Please remove it, and change the comment to "some systems can't use
recv() on non-socket, including HP NonStop".
Also please add a ChangeLog. I'll commit the patch then.
Thanks!
Paolo
> diff --git a/lib/poll.c b/lib/poll.c
> index 5ad9d86..6003fd5 100644
> --- a/lib/poll.c
> +++ b/lib/poll.c
> @@ -303,6 +303,11 @@ compute_revents (int fd, int sought, fd_set *rfds,
> fd_set *
> || socket_errno == ECONNABORTED || socket_errno == ENETRESET)
> happened |= POLLHUP;
>
> +#ifdef __TANDEM /* can't use recv() on non-socket */
> + else if (/* (r == -1) && */ socket_errno == ENOTSOCK)
> + happened |= (POLLIN | POLLRDNORM) & sought;
> +#endif
> +
> else
> happened |= POLLERR;
> }
> @@ -350,7 +355,7 @@ poll (struct pollfd *pfd, nfds_t nfd, int timeout)
>
> /* EFAULT is not necessary to implement, but let's do it in the
> simplest case. */
> - if (!pfd)
> + if (!pfd && nfd)
> {
> errno = EFAULT;
> return -1;
>
>
> I'll send a similar patch to the git list
>
> bye, Jojo
>
>