RE: poll() emulation in git

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> From: Paolo Bonzini [mailto:paolo.bonzini@xxxxxxxxx] On Behalf Of Paolo Bonzini
> Sent: Thursday, September 06, 2012 4:32 PM
> To: Joachim Schmitz
> Cc: git@xxxxxxxxxxxxxxx; 'Junio C Hamano'; 'Erik Faye-Lund'; bug-gnulib@xxxxxxx; rsbecker@xxxxxxxxxxxxx
> Subject: Re: poll() emulation in git
> 
> Il 06/09/2012 16:02, Joachim Schmitz ha scritto:
> > ...
> > # else
> >       char data[64];
> >       r = recv (fd, data, sizeof (data), MSG_PEEK);
> >       socket_errno = (r < 0) ? errno : 0;
> > # endif
> >       if (r == 0)
> >         happened |= POLLHUP;
> >
> >       /* If the event happened on an unconnected server socket,
> >          that's fine. */
> >       else if (r > 0 || ( /* (r == -1) && */ socket_errno == ENOTCONN))
> >         happened |= (POLLIN | POLLRDNORM) & sought;
> >
> >       /* Distinguish hung-up sockets from other errors.  */
> >       else if (socket_errno == ESHUTDOWN || socket_errno == ECONNRESET
> >                || socket_errno == ECONNABORTED || socket_errno == ENETRESET)
> >         happened |= POLLHUP;
> >
> > #ifdef __TANDEM /* as we can't recv(...,MSG_PEEK) on a non-socket */
> >       else if (socket_errno == ENOTSOCK)
> >         happened |= (POLLIN | POLLRDNORM) & sought;
> > #endif
> >       else
> >         happened |= POLLERR;
> >     }
> > ...
> >
> > We won't detect POLLHUP that way I think. However it seems to work, we've been able to clone, push, pull, branch that way with
> > NonStop being the (ssh-)server, something that didn't work at all without that hack (and yes, I believe it is just that).
> > Someone in for a cleaner way of managing this?
> 
> I suppose it works to always handle ENOTSOCK that way, even on
> non-__TANDEM systems.

Will you be fixing this in gnulib? How?

Bye, Jojo

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]