[pypy-commit] pypy errno-again: fixes
arigo
noreply at buildbot.pypy.org
Thu Jan 15 15:49:21 CET 2015
Author: Armin Rigo <arigo at tunes.org>
Branch: errno-again
Changeset: r75348:2985a88ffb08
Date: 2015-01-15 15:42 +0100
http://bitbucket.org/pypy/pypy/changeset/2985a88ffb08/
Log: fixes
diff --git a/pypy/module/cpyext/pyerrors.py b/pypy/module/cpyext/pyerrors.py
--- a/pypy/module/cpyext/pyerrors.py
+++ b/pypy/module/cpyext/pyerrors.py
@@ -167,7 +167,7 @@
this is used to define the filename attribute of the exception instance.
Return value: always NULL."""
# XXX Doesn't actually do anything with PyErr_CheckSignals.
- errno = rposix._get_errno()
+ errno = rffi.cast(lltype.Signed, rposix._get_errno())
msg = os.strerror(errno)
if w_value:
w_error = space.call_function(w_type,
diff --git a/pypy/module/cpyext/pystrtod.py b/pypy/module/cpyext/pystrtod.py
--- a/pypy/module/cpyext/pystrtod.py
+++ b/pypy/module/cpyext/pystrtod.py
@@ -53,8 +53,9 @@
raise OperationError(
space.w_ValueError,
space.wrap('invalid input at position %s' % endpos))
- if rposix._get_errno() == errno.ERANGE:
- rposix._set_errno(0)
+ errno = rffi.cast(lltype.Signed, rposix._get_errno())
+ if errno == errno.ERANGE:
+ rposix._set_errno(rffi.cast(rffi.INT, 0))
if w_overflow_exception is None:
if result > 0:
return rfloat.INFINITY
diff --git a/rpython/rtyper/module/ll_os.py b/rpython/rtyper/module/ll_os.py
--- a/rpython/rtyper/module/ll_os.py
+++ b/rpython/rtyper/module/ll_os.py
@@ -1791,7 +1791,7 @@
ofs = debug.debug_offset()
opaqueaddr = rthread.gc_thread_before_fork()
childpid = rffi.cast(lltype.Signed, os_fork())
- errno = rposix._get_errno()
+ errno = rffi.cast(rffi.Signed, rposix._get_errno())
rthread.gc_thread_after_fork(childpid, opaqueaddr)
if childpid == -1:
raise OSError(errno, "os_fork failed")
More information about the pypy-commit
mailing list