Fixing ioctl on 32bit arches.
authorDerrik Pates <demon@now.ai>
Wed, 14 Mar 2012 16:56:32 +0000 (10:56 -0600)
committerDerrik Pates <demon@now.ai>
Wed, 14 Mar 2012 16:56:32 +0000 (10:56 -0600)
Trying the ioctl tests on ppc netted a problem - seems that even though
I'm casting cmd to "unsigned int", unless I use "newSVuv" instead of
"newSViv", it ends up signed again anyway.

Fuse.xs

diff --git a/Fuse.xs b/Fuse.xs
index 519037c..814fb47 100755 (executable)
--- a/Fuse.xs
+++ b/Fuse.xs
@@ -1489,7 +1489,7 @@ int _PLfuse_ioctl(const char *file, int cmd, void *arg,
        /* I don't know why cmd is a signed int in the first place;
         * casting as unsigned so stupid tricks don't have to be done on
         * the perl side */
-       XPUSHs(sv_2mortal(newSViv((unsigned int)cmd)));
+       XPUSHs(sv_2mortal(newSVuv((unsigned int)cmd)));
        XPUSHs(sv_2mortal(newSViv(flags)));
        if (_IOC_DIR(cmd) & _IOC_WRITE)
                XPUSHs(sv_2mortal(newSVpvn(data, _IOC_SIZE(cmd))));