summaryrefslogtreecommitdiff
path: root/python/rpmfd-py.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2011-03-04 14:33:35 +0200
committerPanu Matilainen <pmatilai@redhat.com>2011-03-04 14:43:54 +0200
commitd69ebf18f100193305c5a49c7ac5c26978db67d2 (patch)
treec52ebe115c775979ecbb276143530596fe6a9c3f /python/rpmfd-py.c
parenta1da07e60d9a43fa7832eab0f4842fff465254e5 (diff)
downloadrpm-d69ebf18f100193305c5a49c7ac5c26978db67d2.tar.gz
rpm-d69ebf18f100193305c5a49c7ac5c26978db67d2.tar.bz2
rpm-d69ebf18f100193305c5a49c7ac5c26978db67d2.zip
Throw an exception from Fseek() errors in python rpmfd.seek()
Diffstat (limited to 'python/rpmfd-py.c')
-rw-r--r--python/rpmfd-py.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/python/rpmfd-py.c b/python/rpmfd-py.c
index 877ed5868..d6103ca9b 100644
--- a/python/rpmfd-py.c
+++ b/python/rpmfd-py.c
@@ -195,7 +195,7 @@ static PyObject *rpmfd_seek(rpmfdObject *s, PyObject *args, PyObject *kwds)
Py_BEGIN_ALLOW_THREADS
rc = Fseek(s->fd, offset, whence);
Py_END_ALLOW_THREADS
- if (Ferror(s->fd)) {
+ if (rc < 0 || Ferror(s->fd)) {
PyErr_SetString(PyExc_IOError, Fstrerror(s->fd));
return NULL;
}