diff options
author | Eric Andersen <andersen@codepoet.org> | 2000-07-08 19:10:29 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2000-07-08 19:10:29 +0000 |
commit | 2cd439f7f075c4b6b6c32412a8e1311d589202e3 (patch) | |
tree | 9a7d23e6772d59c474766b11b0aae10b2aeb2ea5 | |
parent | bd22ed806782eec76929bcd2ec556717e79d24c7 (diff) | |
download | busybox-w32-2cd439f7f075c4b6b6c32412a8e1311d589202e3.tar.gz busybox-w32-2cd439f7f075c4b6b6c32412a8e1311d589202e3.tar.bz2 busybox-w32-2cd439f7f075c4b6b6c32412a8e1311d589202e3.zip |
More cleanup on umount
-Erik
-rw-r--r-- | umount.c | 22 | ||||
-rw-r--r-- | util-linux/umount.c | 22 |
2 files changed, 34 insertions, 10 deletions
@@ -26,20 +26,32 @@ | |||
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <mntent.h> | 27 | #include <mntent.h> |
28 | #include <errno.h> | 28 | #include <errno.h> |
29 | #include <sys/mount.h> | ||
30 | #include <linux/unistd.h> | 29 | #include <linux/unistd.h> |
31 | 30 | ||
32 | 31 | ||
33 | /* Include our own version of umount2 if we need it... */ | 32 | #ifndef MNT_FORCE |
34 | #ifndef __NR_umount2 | ||
35 | #define __NR_umount2 52 | ||
36 | #define MNT_FORCE 1 | 33 | #define MNT_FORCE 1 |
34 | #endif | ||
35 | #ifndef MS_MGC_VAL | ||
37 | #define MS_MGC_VAL 0xc0ed0000 /* Magic number indicatng "new" flags */ | 36 | #define MS_MGC_VAL 0xc0ed0000 /* Magic number indicatng "new" flags */ |
37 | #endif | ||
38 | #ifndef MS_REMOUNT | ||
38 | #define MS_REMOUNT 32 /* Alter flags of a mounted FS. */ | 39 | #define MS_REMOUNT 32 /* Alter flags of a mounted FS. */ |
40 | #endif | ||
41 | #ifndef MS_RDONLY | ||
39 | #define MS_RDONLY 1 /* Mount read-only. */ | 42 | #define MS_RDONLY 1 /* Mount read-only. */ |
40 | |||
41 | #endif | 43 | #endif |
44 | #ifndef __NR_umount2 | ||
45 | #define __NR_umount2 52 | ||
46 | #endif | ||
47 | |||
48 | /* Include our own version of <sys/mount.h>, since libc5 doesn't | ||
49 | * know about umount2 */ | ||
50 | static _syscall1(int, umount, const char *, special_file); | ||
42 | static _syscall2(int, umount2, const char *, special_file, int, flags); | 51 | static _syscall2(int, umount2, const char *, special_file, int, flags); |
52 | static _syscall5(int, mount, const char *, special_file, const char *, dir, | ||
53 | const char *, fstype, unsigned long int, rwflag, const void *, data); | ||
54 | |||
43 | 55 | ||
44 | 56 | ||
45 | static const char umount_usage[] = | 57 | static const char umount_usage[] = |
diff --git a/util-linux/umount.c b/util-linux/umount.c index d790d68ff..4f6edc2e5 100644 --- a/util-linux/umount.c +++ b/util-linux/umount.c | |||
@@ -26,20 +26,32 @@ | |||
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <mntent.h> | 27 | #include <mntent.h> |
28 | #include <errno.h> | 28 | #include <errno.h> |
29 | #include <sys/mount.h> | ||
30 | #include <linux/unistd.h> | 29 | #include <linux/unistd.h> |
31 | 30 | ||
32 | 31 | ||
33 | /* Include our own version of umount2 if we need it... */ | 32 | #ifndef MNT_FORCE |
34 | #ifndef __NR_umount2 | ||
35 | #define __NR_umount2 52 | ||
36 | #define MNT_FORCE 1 | 33 | #define MNT_FORCE 1 |
34 | #endif | ||
35 | #ifndef MS_MGC_VAL | ||
37 | #define MS_MGC_VAL 0xc0ed0000 /* Magic number indicatng "new" flags */ | 36 | #define MS_MGC_VAL 0xc0ed0000 /* Magic number indicatng "new" flags */ |
37 | #endif | ||
38 | #ifndef MS_REMOUNT | ||
38 | #define MS_REMOUNT 32 /* Alter flags of a mounted FS. */ | 39 | #define MS_REMOUNT 32 /* Alter flags of a mounted FS. */ |
40 | #endif | ||
41 | #ifndef MS_RDONLY | ||
39 | #define MS_RDONLY 1 /* Mount read-only. */ | 42 | #define MS_RDONLY 1 /* Mount read-only. */ |
40 | |||
41 | #endif | 43 | #endif |
44 | #ifndef __NR_umount2 | ||
45 | #define __NR_umount2 52 | ||
46 | #endif | ||
47 | |||
48 | /* Include our own version of <sys/mount.h>, since libc5 doesn't | ||
49 | * know about umount2 */ | ||
50 | static _syscall1(int, umount, const char *, special_file); | ||
42 | static _syscall2(int, umount2, const char *, special_file, int, flags); | 51 | static _syscall2(int, umount2, const char *, special_file, int, flags); |
52 | static _syscall5(int, mount, const char *, special_file, const char *, dir, | ||
53 | const char *, fstype, unsigned long int, rwflag, const void *, data); | ||
54 | |||
43 | 55 | ||
44 | 56 | ||
45 | static const char umount_usage[] = | 57 | static const char umount_usage[] = |