lib/ext2fs: don't warn about lack of getmntent on Windows
It is expected that Windows doesn't have getmntent(), so don't warn
about it.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
diff --git a/lib/ext2fs/Android.bp b/lib/ext2fs/Android.bp
index eb4482d..f5cbeec 100644
--- a/lib/ext2fs/Android.bp
+++ b/lib/ext2fs/Android.bp
@@ -121,7 +121,6 @@
enabled: true,
include_dirs: ["external/e2fsprogs/include/mingw"],
cflags: [
- "-Wno-error=cpp",
"-Wno-format",
"-Wno-unused-variable",
"-Wno-error=typedef-redefinition",
diff --git a/lib/ext2fs/ismounted.c b/lib/ext2fs/ismounted.c
index fe64e8b..8fc0b99 100644
--- a/lib/ext2fs/ismounted.c
+++ b/lib/ext2fs/ismounted.c
@@ -408,7 +408,7 @@
#ifdef HAVE_GETMNTINFO
retval = check_getmntinfo(device, mount_flags, mtpt, mtlen);
#else
-#ifdef __GNUC__
+#if defined(__GNUC__) && !defined(_WIN32)
#warning "Can't use getmntent or getmntinfo to check for mounted filesystems!"
#endif
*mount_flags = 0;