diff mbox series

[3/4] lib/ext2fs: don't warn about lack of getmntent on Windows

Message ID 20230128224651.59593-4-ebiggers@kernel.org
State Accepted
Headers show
Series e2fsprogs: a few more warning fixes | expand

Commit Message

Eric Biggers Jan. 28, 2023, 10:46 p.m. UTC
From: Eric Biggers <ebiggers@google.com>

It is expected that Windows doesn't have getmntent(), so don't warn
about it.

Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 lib/ext2fs/Android.bp  | 1 -
 lib/ext2fs/ismounted.c | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

Comments

Theodore Ts'o Jan. 30, 2023, 5:08 a.m. UTC | #1
On Sat, Jan 28, 2023 at 02:46:50PM -0800, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
> 
> It is expected that Windows doesn't have getmntent(), so don't warn
> about it.
> 
> Signed-off-by: Eric Biggers <ebiggers@google.com>

Thanks, applied to the maint branch.

					- Ted
diff mbox series

Patch

diff --git a/lib/ext2fs/Android.bp b/lib/ext2fs/Android.bp
index eb4482d79..f5cbeec9f 100644
--- a/lib/ext2fs/Android.bp
+++ b/lib/ext2fs/Android.bp
@@ -121,7 +121,6 @@  cc_library {
             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 22bc8352b..a7db1a5c4 100644
--- a/lib/ext2fs/ismounted.c
+++ b/lib/ext2fs/ismounted.c
@@ -414,7 +414,7 @@  errcode_t ext2fs_check_mount_point(const char *device, int *mount_flags,
 #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;