[hackers] [ubase] Major mount(8) refactor || Hiltjo Posthuma
commit 35e3f401ab0d00d7ff06217eb8d6ac28c2895dc3
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Sat Mar 15 13:26:32 2014 +0000
Major mount(8) refactor
diff --git a/mount.c b/mount.c
index 87365ae..afcfee4 100644
--- a/mount.c
+++ b/mount.c
_AT_@ -15,46 +15,79 @@ struct {
const char *notopt;
unsigned long v;
} optnames[] = {
- { "remount", NULL, MS_REMOUNT },
- { "ro", "rw", MS_RDONLY },
- { "sync", "async", MS_SYNCHRONOUS },
- { "dirsync", NULL, MS_DIRSYNC },
- { "nodev", "dev", MS_NODEV },
- { "noatime", "atime", MS_NOATIME },
- { "nodiratime", "diratime", MS_NODIRATIME },
- { "noexec", "exec", MS_NOEXEC },
- { "nosuid", "suid", MS_NOSUID },
- { "mand", "nomand", MS_MANDLOCK },
- { "relatime", "norelatime", MS_RELATIME },
- { NULL, NULL, 0 }
+ { "remount", NULL, MS_REMOUNT },
+ { "ro", "rw", MS_RDONLY },
+ { "sync", "async", MS_SYNCHRONOUS },
+ { "dirsync", NULL, MS_DIRSYNC },
+ { "nodev", "dev", MS_NODEV },
+ { "noatime", "atime", MS_NOATIME },
+ { "nodiratime", "diratime", MS_NODIRATIME },
+ { "noexec", "exec", MS_NOEXEC },
+ { "nosuid", "suid", MS_NOSUID },
+ { "mand", "nomand", MS_MANDLOCK },
+ { "relatime", "norelatime", MS_RELATIME },
+ { "bind", NULL, MS_BIND },
+ { NULL, NULL, 0 }
};
-static struct option {
+static void
+parseopts(char *popts, unsigned long *flags, char *data, size_t bufsiz)
+{
+ unsigned int i, validopt;
+ size_t optlen, dlen = 0;
char *name;
- struct option *next;
-} *opthead;
+
+ data[0] = '
Received on Sat Mar 15 2014 - 14:27:07 CET
This archive was generated by hypermail 2.3.0
: Sat Mar 15 2014 - 14:36:17 CET