[pypy-commit] pypy errno-again: fix
arigo
noreply at buildbot.pypy.org
Thu Jan 15 15:56:02 CET 2015
Author: Armin Rigo <arigo at tunes.org>
Branch: errno-again
Changeset: r75351:c778135940cd
Date: 2015-01-15 15:55 +0100
http://bitbucket.org/pypy/pypy/changeset/c778135940cd/
Log: fix
diff --git a/pypy/module/_cffi_backend/ctypeptr.py b/pypy/module/_cffi_backend/ctypeptr.py
--- a/pypy/module/_cffi_backend/ctypeptr.py
+++ b/pypy/module/_cffi_backend/ctypeptr.py
@@ -347,7 +347,8 @@
# ____________________________________________________________
-rffi_fdopen = rffi.llexternal("fdopen", [rffi.INT, rffi.CCHARP], rffi.CCHARP)
+rffi_fdopen = rffi.llexternal("fdopen", [rffi.INT, rffi.CCHARP], rffi.CCHARP,
+ save_err=rffi.RFFI_SAVE_ERRNO)
rffi_setbuf = rffi.llexternal("setbuf", [rffi.CCHARP, rffi.CCHARP], lltype.Void)
rffi_fclose = rffi.llexternal("fclose", [rffi.CCHARP], rffi.INT)
@@ -357,7 +358,7 @@
def __init__(self, fd, mode):
self.llf = rffi_fdopen(fd, mode)
if not self.llf:
- raise OSError(rposix.get_errno(), "fdopen failed")
+ raise OSError(rposix.get_saved_errno(), "fdopen failed")
rffi_setbuf(self.llf, lltype.nullptr(rffi.CCHARP.TO))
def close(self):
More information about the pypy-commit
mailing list