summaryrefslogtreecommitdiff
path: root/fuse.py
diff options
context:
space:
mode:
authorverigak <verigak@1ebed218-b0a3-11dd-8075-91d349ce83ee>2009-10-05 16:15:29 +0000
committerverigak <verigak@1ebed218-b0a3-11dd-8075-91d349ce83ee>2009-10-05 16:15:29 +0000
commitdecfd0bcc969e7547658dc0b81792b1b1e1a9941 (patch)
treea15ab29bbc10150507ca7ffec1fcaf8d3c606fd3 /fuse.py
parenta60324ce402e6e90e70be390ec908e13c48cc4a7 (diff)
downloadfusepy-decfd0bcc969e7547658dc0b81792b1b1e1a9941.tar.gz
Fix segfault of fuse_get_context().
git-svn-id: http://fusepy.googlecode.com/svn/trunk@32 1ebed218-b0a3-11dd-8075-91d349ce83ee
Diffstat (limited to 'fuse.py')
-rw-r--r--fuse.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/fuse.py b/fuse.py
index 8ab68d8..11998df 100644
--- a/fuse.py
+++ b/fuse.py
@@ -210,12 +210,13 @@ _libfuse_path = find_library('fuse')
if not _libfuse_path:
raise EnvironmentError('Unable to find libfuse')
_libfuse = CDLL(_libfuse_path)
+_libfuse.fuse_get_context.restype = POINTER(fuse_context)
def fuse_get_context():
"""Returns a (uid, gid, pid) tuple"""
- p = _libfuse.fuse_get_context()
- ctx = cast(p, POINTER(fuse_context)).contents
+ ctxp = _libfuse.fuse_get_context()
+ ctx = ctxp.contents
return ctx.uid, ctx.gid, ctx.pid