aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2019-03-30 11:24:00 +0000
committerRon Yorston <rmy@pobox.com>2019-03-30 11:24:00 +0000
commit077d4c21c0e48e495bc86ea0dec28e5a7143efa8 (patch)
treeeebcad878cd140ea28c5e783c8826d93aa566c60
parent548ec7045bc7c80eaf03e92f390d1da2c9e9cd86 (diff)
downloadbusybox-w32-077d4c21c0e48e495bc86ea0dec28e5a7143efa8.tar.gz
busybox-w32-077d4c21c0e48e495bc86ea0dec28e5a7143efa8.tar.bz2
busybox-w32-077d4c21c0e48e495bc86ea0dec28e5a7143efa8.zip
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.
-rw-r--r--win32/mntent.c7
-rw-r--r--win32/mntent.h4
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 @@
1/* 1/*
2 * A simple WIN32 implementation of mntent routines. It only handles 2 * A simple WIN32 implementation of mntent routines. It only handles
3 * fixed logical drives. 3 * logical drives.
4 */ 4 */
5#include "libbb.h" 5#include "libbb.h"
6 6
@@ -14,7 +14,7 @@ struct mntdata {
14 char mnt_opts[4]; 14 char mnt_opts[4];
15}; 15};
16 16
17FILE *setmntent(const char *file UNUSED_PARAM, const char *mode UNUSED_PARAM) 17FILE *mingw_setmntent(void)
18{ 18{
19 struct mntdata *data; 19 struct mntdata *data;
20 20
@@ -56,7 +56,8 @@ struct mntent *getmntent(FILE *stream)
56 56
57 drive_type = GetDriveType(data->mnt_dir); 57 drive_type = GetDriveType(data->mnt_dir);
58 if ( drive_type == DRIVE_FIXED || drive_type == DRIVE_CDROM || 58 if ( drive_type == DRIVE_FIXED || drive_type == DRIVE_CDROM ||
59 drive_type == DRIVE_REMOVABLE) { 59 drive_type == DRIVE_REMOVABLE ||
60 drive_type == DRIVE_REMOTE ) {
60 if ( !GetVolumeInformation(data->mnt_dir, NULL, 0, NULL, NULL, 61 if ( !GetVolumeInformation(data->mnt_dir, NULL, 0, NULL, NULL,
61 NULL, data->mnt_type, 100) ) { 62 NULL, data->mnt_type, 100) ) {
62 continue; 63 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 {
12 int mnt_passno; /* Pass number for `fsck'. */ 12 int mnt_passno; /* Pass number for `fsck'. */
13}; 13};
14 14
15extern FILE *setmntent(const char *file, const char *mode); 15extern FILE *mingw_setmntent(void);
16extern struct mntent *getmntent(FILE *stream); 16extern struct mntent *getmntent(FILE *stream);
17extern int endmntent(FILE *stream); 17extern int endmntent(FILE *stream);
18 18
19#define setmntent(f, m) mingw_setmntent()
20
19#endif 21#endif