projects
/
perl-fuse.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5c56fe0
)
Cast the 'cmd' argument as unsigned.
author
Derrik Pates
<demon@now.ai>
Tue, 2 Aug 2011 19:33:42 +0000
(13:33 -0600)
committer
Derrik Pates
<demon@now.ai>
Tue, 2 Aug 2011 19:33:42 +0000
(13:33 -0600)
Fuse.xs
patch
|
blob
|
history
examples/fioc.pl
patch
|
blob
|
history
diff --git
a/Fuse.xs
b/Fuse.xs
index
8d609fa
..
893f1a0
100755
(executable)
--- a/
Fuse.xs
+++ b/
Fuse.xs
@@
-1430,7
+1430,10
@@
int _PLfuse_ioctl(const char *file, int cmd, void *arg,
SAVETMPS;
PUSHMARK(SP);
XPUSHs(sv_2mortal(newSVpv(file,0)));
SAVETMPS;
PUSHMARK(SP);
XPUSHs(sv_2mortal(newSVpv(file,0)));
- XPUSHs(sv_2mortal(newSViv(cmd)));
+ /* 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(newSViv(flags)));
if (_IOC_DIR(cmd) & _IOC_WRITE)
XPUSHs(sv_2mortal(newSVpvn(data, _IOC_SIZE(cmd))));
XPUSHs(sv_2mortal(newSViv(flags)));
if (_IOC_DIR(cmd) & _IOC_WRITE)
XPUSHs(sv_2mortal(newSVpvn(data, _IOC_SIZE(cmd))));
diff --git
a/examples/fioc.pl
b/examples/fioc.pl
index
3461180
..
811cb80
100755
(executable)
--- a/
examples/fioc.pl
+++ b/
examples/fioc.pl
@@
-147,7
+147,6
@@
sub fioc_readdir {
sub fioc_ioctl {
my ($path, $cmd, $flags, $data) = @_;
print 'called ', (caller(0))[3], "\n";
sub fioc_ioctl {
my ($path, $cmd, $flags, $data) = @_;
print 'called ', (caller(0))[3], "\n";
- $cmd = unpack('L', pack('l', $cmd));
return -&EINVAL if fioc_file_type($path) != FIOC_FILE;
return -&EINVAL if fioc_file_type($path) != FIOC_FILE;