aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-06-19 18:38:51 +0000
committerEric Andersen <andersen@codepoet.org>2000-06-19 18:38:51 +0000
commite1e23eecab5bab12fbe025eea01e730a1e3e1f3f (patch)
tree319366ea13e032a03366e187da77e9c0e0d9d023
parent5e29c6ffce509bc492a2acc4dd4102ac96d0f515 (diff)
downloadbusybox-w32-e1e23eecab5bab12fbe025eea01e730a1e3e1f3f.tar.gz
busybox-w32-e1e23eecab5bab12fbe025eea01e730a1e3e1f3f.tar.bz2
busybox-w32-e1e23eecab5bab12fbe025eea01e730a1e3e1f3f.zip
Make umount work and compile cleanly under libc5 and libc6.
-Erik
-rw-r--r--umount.c21
-rw-r--r--util-linux/umount.c21
2 files changed, 32 insertions, 10 deletions
diff --git a/umount.c b/umount.c
index 86833b717..4aed989fb 100644
--- a/umount.c
+++ b/umount.c
@@ -24,9 +24,22 @@
24 24
25#include "internal.h" 25#include "internal.h"
26#include <stdio.h> 26#include <stdio.h>
27#include <sys/mount.h> 27//#include <sys/mount.h>
28#include <mntent.h> 28#include <mntent.h>
29#include <errno.h> 29#include <errno.h>
30#include <linux/unistd.h>
31
32
33/* Include our own version of sys/mount.h, since libc5 doesn't
34 * know about umount2 */
35static _syscall1(int, umount, const char *, special_file);
36static _syscall2(int, umount2, const char *, special_file, int, flags);
37static _syscall5(int, mount, const char *, special_file, const char *, dir,
38 const char *, fstype, unsigned long int, rwflag, const void *, data);
39#define MNT_FORCE 1
40#define MS_MGC_VAL 0xc0ed0000 /* Magic flag number to indicate "new" flags */
41#define MS_REMOUNT 32 /* Alter flags of a mounted FS. */
42#define MS_RDONLY 1 /* Mount read-only. */
30 43
31 44
32static const char umount_usage[] = 45static const char umount_usage[] =
@@ -286,9 +299,7 @@ extern int umount_main(int argc, char **argv)
286 } 299 }
287 if (do_umount(*argv, useMtab) == 0) 300 if (do_umount(*argv, useMtab) == 0)
288 exit(TRUE); 301 exit(TRUE);
289 else { 302 perror("umount");
290 perror("umount"); 303 return(FALSE);
291 exit(FALSE);
292 }
293} 304}
294 305
diff --git a/util-linux/umount.c b/util-linux/umount.c
index 86833b717..4aed989fb 100644
--- a/util-linux/umount.c
+++ b/util-linux/umount.c
@@ -24,9 +24,22 @@
24 24
25#include "internal.h" 25#include "internal.h"
26#include <stdio.h> 26#include <stdio.h>
27#include <sys/mount.h> 27//#include <sys/mount.h>
28#include <mntent.h> 28#include <mntent.h>
29#include <errno.h> 29#include <errno.h>
30#include <linux/unistd.h>
31
32
33/* Include our own version of sys/mount.h, since libc5 doesn't
34 * know about umount2 */
35static _syscall1(int, umount, const char *, special_file);
36static _syscall2(int, umount2, const char *, special_file, int, flags);
37static _syscall5(int, mount, const char *, special_file, const char *, dir,
38 const char *, fstype, unsigned long int, rwflag, const void *, data);
39#define MNT_FORCE 1
40#define MS_MGC_VAL 0xc0ed0000 /* Magic flag number to indicate "new" flags */
41#define MS_REMOUNT 32 /* Alter flags of a mounted FS. */
42#define MS_RDONLY 1 /* Mount read-only. */
30 43
31 44
32static const char umount_usage[] = 45static const char umount_usage[] =
@@ -286,9 +299,7 @@ extern int umount_main(int argc, char **argv)
286 } 299 }
287 if (do_umount(*argv, useMtab) == 0) 300 if (do_umount(*argv, useMtab) == 0)
288 exit(TRUE); 301 exit(TRUE);
289 else { 302 perror("umount");
290 perror("umount"); 303 return(FALSE);
291 exit(FALSE);
292 }
293} 304}
294 305