Opened 8 years ago

Closed 8 years ago

#7935 closed enhancement (fixed)

non-_WIN32 platforms don't consider EWOULDBLOCK in ERRNO_IS_EAGAIN()

Reported by: asn Owned by:
Priority: Low Milestone: Tor: 0.2.4.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: tor-client
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

#if defined(_WIN32)
...
#define ERRNO_IS_EAGAIN(e)           ((e) == EAGAIN || (e) == WSAEWOULDBLOCK)
...
#else
...
#define ERRNO_IS_EAGAIN(e)           ((e) == EAGAIN)

EAGAIN and EWOULDBLOCK have the same errno in most platforms, but there are some cases where it's not the same:
http://stackoverflow.com/questions/7003234/which-systems-define-eagain-and-ewouldblock-as-different-values

Reported by oftc_must_be_destroyed.

Child Tickets

Change History (3)

comment:1 Changed 8 years ago by nickm

Priority: normalminor
Status: newneeds_review
Type: defectenhancement

Hm. I haven't heard about anybody building Tor on any of those systems for a long time, but it looks like an easy fix. I'm calling this a feature because afaict no version of Tor has ever supported checking for EWOULDBLOCK from these syscalls.

See branch "bug7935" in my public repo. I'm doing a fix for this in libevent too.

comment:2 Changed 8 years ago by asn

Looks good to me.

comment:3 Changed 8 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

okay, merging.

Note: See TracTickets for help on using tickets.