From 077d4c21c0e48e495bc86ea0dec28e5a7143efa8 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sat, 30 Mar 2019 11:24:00 +0000 Subject: win32: update implementation of setmntent(3) - The arguments to setmntent(3) are unused: add a macro to drop them at call sites. - Allow remote drives. --- win32/mntent.c | 7 ++++--- win32/mntent.h | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/win32/mntent.c b/win32/mntent.c index 2a07476e3..6d6ba319f 100644 --- a/win32/mntent.c +++ b/win32/mntent.c @@ -1,6 +1,6 @@ /* * A simple WIN32 implementation of mntent routines. It only handles - * fixed logical drives. + * logical drives. */ #include "libbb.h" @@ -14,7 +14,7 @@ struct mntdata { char mnt_opts[4]; }; -FILE *setmntent(const char *file UNUSED_PARAM, const char *mode UNUSED_PARAM) +FILE *mingw_setmntent(void) { struct mntdata *data; @@ -56,7 +56,8 @@ struct mntent *getmntent(FILE *stream) drive_type = GetDriveType(data->mnt_dir); if ( drive_type == DRIVE_FIXED || drive_type == DRIVE_CDROM || - drive_type == DRIVE_REMOVABLE) { + drive_type == DRIVE_REMOVABLE || + drive_type == DRIVE_REMOTE ) { if ( !GetVolumeInformation(data->mnt_dir, NULL, 0, NULL, NULL, NULL, data->mnt_type, 100) ) { continue; diff --git a/win32/mntent.h b/win32/mntent.h index b035bfa9c..8bdf3d45e 100644 --- a/win32/mntent.h +++ b/win32/mntent.h @@ -12,8 +12,10 @@ struct mntent { int mnt_passno; /* Pass number for `fsck'. */ }; -extern FILE *setmntent(const char *file, const char *mode); +extern FILE *mingw_setmntent(void); extern struct mntent *getmntent(FILE *stream); extern int endmntent(FILE *stream); +#define setmntent(f, m) mingw_setmntent() + #endif -- cgit v1.2.3-55-g6feb