From: Brandon Low Date: Mon, 14 Feb 2011 23:51:16 +0000 (-0800) Subject: Fix a valid warning that some compilers warned X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=33eb18ae204bfd10cb44c04de217d5713be7d8a9;p=packages%2Fb%2Fbup.git Fix a valid warning that some compilers warned And it's a good idea not to ignore fwrite's return value I suppose. Signed-off-by: Brandon Low --- diff --git a/lib/bup/_helpers.c b/lib/bup/_helpers.c index df104cf..594ff0f 100644 --- a/lib/bup/_helpers.c +++ b/lib/bup/_helpers.c @@ -472,7 +472,8 @@ static PyObject *write_idx(PyObject *self, PyObject *args) if (ofs > 0x7fffffff) { uint64_t nofs = htonll(ofs); - fwrite(&nofs, 8, 1, f); + if (fwrite(&nofs, 8, 1, f) != 1) + return PyErr_SetFromErrno(PyExc_OSError); ofs = 0x80000000 | ofs64_count++; } *ofs_ptr++ = htonl((uint32_t)ofs);