> From: Paolo Bonzini [mailto:paolo.bonz...@gmail.com] On Behalf Of Paolo > Bonzini > Sent: Friday, September 07, 2012 11:41 AM > To: Joachim Schmitz > Cc: g...@vger.kernel.org; 'Junio C Hamano'; 'Erik Faye-Lund'; > bug-gnulib@gnu.org; rsbec...@nexbridge.com > 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... 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