Re: What's cooking in git.git (Aug 2010, #02; Wed, 11)

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

 



On Thu, Aug 12, 2010 at 12:31:33PM +0200, Johannes Sixt wrote:
>
> builtin/remote-ext.c uses a loop that looks very much like what
> write_in_full() does; transport-helper.c's checks for EAGAIN look very
> similar to xwrite(). Why can't you reuse these functions?

Ah, the request sending loop (send_git_request()), not the bidirectional loop
(my bad). Yes, that function can be simplified a lot (patch sent).

> > [1] Some systems return EAGAIN on read/write failed due to blocking (with
> > EAGAIN == EWOULDBLOCK), others return EWOULDBLOCK.
> 
> But shouldn't then xwrite() and xread() be extended to check also for
> EWOULDBLOCK?

Based on what I understand, yes. read() and write() that fails due to blocking
being needed but disabled returns EWOULDBLOCK, which may or may not be the
same as EAGAIN, so the return value in no-blocking case equals EAGAIN only
if EAGAIN == EWOULDBLOCK, which isn't guaranteed.

Have a macro that does the non-fatal error check?

-Ilari
--
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]