Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions fuseparts/_fusemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1272,15 +1272,36 @@ poll_func(const char *path, struct fuse_file_info *fi,
struct fuse_pollhandle *ph, unsigned *reventsp)
{
PyObject *pollhandle = Py_None;
int ret = -EINVAL;
PyObject *v;

if (ph)
PYLOCK();

if (ph) {
pollhandle = PyCapsule_New(ph, pollhandle_name, pollhandle_destructor);
if (!pollhandle) {
PyErr_Print();
goto OUT;
}
}

#ifdef FIX_PATH_DECODING
PROLOGUE(PYO_CALLWITHFI(fi, poll_cb, O&O, &Path_AsDecodedUnicode, path, pollhandle));
v = PYO_CALLWITHFI(fi, poll_cb, O&O, &Path_AsDecodedUnicode, path, pollhandle);
#else
PROLOGUE(PYO_CALLWITHFI(fi, poll_cb, sO, path, pollhandle));
v = PYO_CALLWITHFI(fi, poll_cb, sO, path, pollhandle);
#endif
if (!v) {
PyErr_Print();
goto OUT;
}
if (v == Py_None) {
ret = 0;
goto OUT_DECREF;
}
if (PyInt_Check(v)) {
ret = PyInt_AsLong(v);
goto OUT_DECREF;
}

OUT_DECREF:
Py_DECREF(v);
Expand Down
Loading