summaryrefslogtreecommitdiff
path: root/lib/e2p/fgetversion.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/e2p/fgetversion.c')
-rw-r--r--lib/e2p/fgetversion.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/e2p/fgetversion.c b/lib/e2p/fgetversion.c
index fea376b0..525081ee 100644
--- a/lib/e2p/fgetversion.c
+++ b/lib/e2p/fgetversion.c
@@ -28,13 +28,13 @@
int fgetversion (const char * name, unsigned long * version)
{
#if HAVE_EXT2_IOCTLS
- int fd;
- int r;
+ int fd, r, ver;
fd = open (name, O_RDONLY|O_NONBLOCK);
if (fd == -1)
return - 1;
- r = ioctl (fd, EXT2_IOC_GETVERSION, version);
+ r = ioctl (fd, EXT2_IOC_GETVERSION, ver);
+ *version = ver;
close (fd);
return r;
#else /* ! HAVE_EXT2_IOCTLS */