diff options
author | Ron Yorston <rmy@pobox.com> | 2019-03-20 11:31:07 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2019-03-20 11:38:32 +0000 |
commit | a8c63f25b3a8d4b8c9e12b8f6db65c61596da602 (patch) | |
tree | 7c39ee80787a2eba5702246a1b6f24276290f8c8 /win32/mntent.c | |
parent | 18bffeae48f300c813a4999067373498b534c166 (diff) | |
download | busybox-w32-a8c63f25b3a8d4b8c9e12b8f6db65c61596da602.tar.gz busybox-w32-a8c63f25b3a8d4b8c9e12b8f6db65c61596da602.tar.bz2 busybox-w32-a8c63f25b3a8d4b8c9e12b8f6db65c61596da602.zip |
win32: improve filesystem detection and display
Miscellaneous improvements:
- Enable '-a' option to display all filesystems in df(1).
- Detect the UDF CDROM filesystem and display it in 'stat -f'.
- Let getmntent(3) handle CDROM and floppy devices, ignoring those
that have no media.
- Set number of inodes and filesystem flags to 0 in statfs(2).
Diffstat (limited to 'win32/mntent.c')
-rw-r--r-- | win32/mntent.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/win32/mntent.c b/win32/mntent.c index f9a2d26d4..2a07476e3 100644 --- a/win32/mntent.c +++ b/win32/mntent.c | |||
@@ -32,6 +32,7 @@ struct mntent *getmntent(FILE *stream) | |||
32 | { | 32 | { |
33 | struct mntdata *data = (struct mntdata *)stream; | 33 | struct mntdata *data = (struct mntdata *)stream; |
34 | struct mntent *entry; | 34 | struct mntent *entry; |
35 | UINT drive_type; | ||
35 | 36 | ||
36 | data->me.mnt_fsname = data->mnt_fsname; | 37 | data->me.mnt_fsname = data->mnt_fsname; |
37 | data->me.mnt_dir = data->mnt_dir; | 38 | data->me.mnt_dir = data->mnt_dir; |
@@ -48,15 +49,17 @@ struct mntent *getmntent(FILE *stream) | |||
48 | data->mnt_fsname[2] = '\0'; | 49 | data->mnt_fsname[2] = '\0'; |
49 | data->mnt_dir[0] = 'A' + data->index; | 50 | data->mnt_dir[0] = 'A' + data->index; |
50 | data->mnt_dir[1] = ':'; | 51 | data->mnt_dir[1] = ':'; |
51 | data->mnt_dir[2] = '\\'; | 52 | data->mnt_dir[2] = '/'; |
52 | data->mnt_dir[3] = '\0'; | 53 | data->mnt_dir[3] = '\0'; |
53 | data->mnt_type[0] = '\0'; | 54 | data->mnt_type[0] = '\0'; |
54 | data->mnt_opts[0] = '\0'; | 55 | data->mnt_opts[0] = '\0'; |
55 | 56 | ||
56 | if ( GetDriveType(data->mnt_dir) == DRIVE_FIXED ) { | 57 | drive_type = GetDriveType(data->mnt_dir); |
58 | if ( drive_type == DRIVE_FIXED || drive_type == DRIVE_CDROM || | ||
59 | drive_type == DRIVE_REMOVABLE) { | ||
57 | if ( !GetVolumeInformation(data->mnt_dir, NULL, 0, NULL, NULL, | 60 | if ( !GetVolumeInformation(data->mnt_dir, NULL, 0, NULL, NULL, |
58 | NULL, data->mnt_type, 100) ) { | 61 | NULL, data->mnt_type, 100) ) { |
59 | data->mnt_type[0] = '\0'; | 62 | continue; |
60 | } | 63 | } |
61 | 64 | ||
62 | entry = &data->me; | 65 | entry = &data->me; |