backwards compatibility, schmackwards schompatibility! LGTM
2009/3/18 <[email protected]>: > Reviewers: Erik Corry, > > Description: > Circumvent a bug in older glibc. > > In glibc prior to 2.3.4 the return value from sem_timedwait is not -1 > when it fails, but the actual error code. > > Turned out that our ARM setup uses glibc 2.3.2. > > Please review this at http://codereview.chromium.org/42325 > > SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/ > > Affected files: > M src/platform-linux.cc > > > Index: src/platform-linux.cc > =================================================================== > --- src/platform-linux.cc (revision 1527) > +++ src/platform-linux.cc (working copy) > @@ -634,6 +634,11 @@ > while (true) { > int result = sem_timedwait(&sem_, &ts); > if (result == 0) return true; // Successfully got semaphore. > + if (result > 0) { > + // For glibc prior to 2.3.4 sem_timedwait returns the error instead > of -1. > + errno = result; > + result = -1; > + } > if (result == -1 && errno == ETIMEDOUT) return false; // Timeout. > CHECK(result == -1 && errno == EINTR); // Signal caused spurious > wakeup. > } > > > -- Erik Corry, Software Engineer Google Denmark ApS. CVR nr. 28 86 69 84 c/o Philip & Partners, 7 Vognmagergade, P.O. Box 2227, DK-1018 Copenhagen K, Denmark. --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
