Author: Joannah Nanjekye <[email protected]>
Branch: jumbo
Changeset: r90653:14dc42986418
Date: 2017-03-02 19:36 +0300
http://bitbucket.org/pypy/pypy/changeset/14dc42986418/

Log:    pwrite fix

diff --git a/pypy/module/posix/interp_posix.py 
b/pypy/module/posix/interp_posix.py
--- a/pypy/module/posix/interp_posix.py
+++ b/pypy/module/posix/interp_posix.py
@@ -392,12 +392,13 @@
     """Write a string to a file descriptor at a given offset.
     """
     data = space.getarg_w('y*', w_data)
-    try:
-        res = os.write(fd, data.as_str())
-    except OSError as e:
-        raise wrap_oserror(space, e, eintr_retry=True)
-    else:
-        return space.newint(res)
+    while True:
+        try:
+            res = rposix.pwrite(fd, data.as_str(), offset)
+        except OSError as e:
+            wrap_oserror(space, e, eintr_retry=True)
+        else:
+            return space.newint(res)
 
 # ____________________________________________________________
 
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to