X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fbup%2F_helpers.c;h=592c1217d077ad3c9e5ae68b6ea517927c485a84;hb=a67c04f3666d92a66f4a4c5e0b4788fe4949cd22;hp=87e8b82755d581762db9d9943fc822ed4cf5fb77;hpb=dba5c9d58d897796d0167a9c2e4f7099ea9d085c;p=bup.git diff --git a/lib/bup/_helpers.c b/lib/bup/_helpers.c index 87e8b82..592c121 100644 --- a/lib/bup/_helpers.c +++ b/lib/bup/_helpers.c @@ -29,6 +29,9 @@ #ifdef HAVE_UNISTD_H #include #endif +#ifdef HAVE_SYS_TIME_H +#include +#endif #ifdef HAVE_LINUX_FS_H #include @@ -71,10 +74,10 @@ typedef struct { #if PY_MAJOR_VERSION < 3 static state_t state; # define get_state(x) (&state) -# define buf_argf "s" +# define cstr_argf "s" #else # define get_state(x) ((state_t *) PyModule_GetState(x)) -# define buf_argf "y" +# define cstr_argf "y" #endif // PY_MAJOR_VERSION >= 3 @@ -1405,7 +1408,7 @@ static PyObject *bup_stat(PyObject *self, PyObject *args) int rc; char *filename; - if (!PyArg_ParseTuple(args, "s", &filename)) + if (!PyArg_ParseTuple(args, cstr_argf, &filename)) return NULL; struct stat st; @@ -1421,7 +1424,7 @@ static PyObject *bup_lstat(PyObject *self, PyObject *args) int rc; char *filename; - if (!PyArg_ParseTuple(args, "s", &filename)) + if (!PyArg_ParseTuple(args, cstr_argf, &filename)) return NULL; struct stat st; @@ -1478,7 +1481,7 @@ static PyObject *bup_mincore(PyObject *self, PyObject *args) Py_buffer src, dest; PyObject *py_src_n, *py_src_off, *py_dest_off; - if (!PyArg_ParseTuple(args, buf_argf "*OOw*O", + if (!PyArg_ParseTuple(args, cstr_argf "*OOw*O", &src, &py_src_n, &py_src_off, &dest, &py_dest_off)) return NULL;