[Python-checkins] cpython: os.sendfile(): on Linux if offset parameter is passed as NULL we were

giampaolo.rodola python-checkins at python.org
Tue Apr 19 09:47:21 CEST 2011


http://hg.python.org/cpython/rev/8c49f7fbba1d
changeset:   69437:8c49f7fbba1d
user:        Giampaolo Rodola' <g.rodola at gmail.com>
date:        Tue Apr 19 09:47:16 2011 +0200
summary:
  os.sendfile(): on Linux if offset parameter is passed as NULL we were erroneously returning a (bytes_sent, None) tuple instead of bytes_sent

files:
  Modules/posixmodule.c |  5 ++---
  1 files changed, 2 insertions(+), 3 deletions(-)


diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -6450,8 +6450,7 @@
         Py_END_ALLOW_THREADS
         if (ret < 0)
             return posix_error();
-        Py_INCREF(Py_None);
-        return Py_BuildValue("nO", ret, Py_None);
+        return Py_BuildValue("n", ret);
     }
 #endif
     if (!_parse_off_t(offobj, &offset))
@@ -8730,7 +8729,7 @@
     long uid, gid;
     int flags = 0;
     char *path;
-    
+
     if (!PyArg_ParseTuple(args, "iO&ll|i:fchownat",
             &dirfd, PyUnicode_FSConverter, &opath, &uid, &gid, &flags))
         return NULL;

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list