Fix e7e136da (Add device_is_mounted() support for BSDs)
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Mon, 17 Oct 2016 14:17:40 +0000 (23:17 +0900)
committerJens Axboe <axboe@fb.com>
Mon, 17 Oct 2016 14:12:59 +0000 (08:12 -0600)
The actual C code was good, but the code to check getmntinfo(3)
in ./configure was missing * for st. getmntinfo(3) on FreeBSD/
DragonFlyBSD/etc takes statfs** as an argument.

I failed to catch this error as gcc without -Werror only gives
warning and sets $? to 0, though as a result it didn't break anything.

It did nothing to Linux since getmntinfo(3) doesn't compile on
Linux whether arg is * or **.

Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
configure

index a24e3eff7fd4985ba66fe4a8a0aedcc6d3f14088..e8e695313e24c11d1f6d92db4a60681a0854a9f3 100755 (executable)
--- a/configure
+++ b/configure
@@ -1628,7 +1628,7 @@ cat > $TMPC << EOF
 #include <sys/mount.h>
 int main(int argc, char **argv)
 {
 #include <sys/mount.h>
 int main(int argc, char **argv)
 {
-  struct statfs st;
+  struct statfs *st;
   return getmntinfo(&st, MNT_NOWAIT);
 }
 EOF
   return getmntinfo(&st, MNT_NOWAIT);
 }
 EOF