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:
44dd3e0
)
Handle the ioctl call returns better.
author
Derrik Pates
<demon@now.ai>
Tue, 2 Aug 2011 04:53:53 +0000
(22:53 -0600)
committer
Derrik Pates
<demon@now.ai>
Tue, 2 Aug 2011 04:53:53 +0000
(22:53 -0600)
examples/fioclient.pl
patch
|
blob
|
history
diff --git
a/examples/fioclient.pl
b/examples/fioclient.pl
index
7abb683
..
c961d2e
100755
(executable)
--- a/
examples/fioclient.pl
+++ b/
examples/fioclient.pl
@@
-43,13
+43,14
@@
if ($ARGV[1] eq 's') {
if (!defined $ARGV[2]) {
my $size;
my $rv = ioctl($file, FIOC_GET_SIZE, $size);
- if (
ioctl($file, FIOC_GET_SIZE, $size)
!= 0) {
+ if (
!defined($rv) || $rv
!= 0) {
croak($!);
}
printf("\%u\n", unpack('L', $size));
}
else {
- if (ioctl($file, FIOC_SET_SIZE, pack('L', $ARGV[2])) != 0) {
+ my $rv = ioctl($file, FIOC_SET_SIZE, pack('L', $ARGV[2]));
+ if (!defined($rv) || $rv != 0) {
croak($!);
}
}