]> granicus.if.org Git - strace/commitdiff
2007-01-11 Dmitry V. Levin <ldv@altlinux.org>
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 13 Jan 2007 11:15:48 +0000 (11:15 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 13 Jan 2007 11:15:48 +0000 (11:15 +0000)
Update umount parser.
* system.c [LINUX] (MNT_FORCE, MNT_DETACH, MNT_EXPIRE): New macros.
[LINUX] (umount_flags): New xlat structure with MNT_* entries.
[LINUX] (sys_umount2): Use umount_flags.

ChangeLog
system.c

index ecab1df24baf578135b80cb8adcbccaf3639e7a7..4ab49ca29e3d0f5d4dc05631fec28d31ef43b5e3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2007-01-11  Dmitry V. Levin <ldv@altlinux.org>
 
+       Update umount parser.
+       * system.c [LINUX] (MNT_FORCE, MNT_DETACH, MNT_EXPIRE): New macros.
+       [LINUX] (umount_flags): New xlat structure with MNT_* entries.
+       [LINUX] (sys_umount2): Use umount_flags.
+
        Fix open(2) flags parser.
        * defs.h (tprint_open_modes): New function.
        * desc.c (sprint_open_modes): New function.
index 5752f4f855be07abc96701da9b87fbd43840d64e..0970d710ee2a260743dd1d3e011b32a4dcf967ac 100644 (file)
--- a/system.c
+++ b/system.c
@@ -124,17 +124,24 @@ struct tcb *tcp;
        return 0;
 }
 
+#define MNT_FORCE      0x00000001      /* Attempt to forcibily umount */
+#define MNT_DETACH     0x00000002      /* Just detach from the tree */
+#define MNT_EXPIRE     0x00000004      /* Mark for expiry */
+
+static const struct xlat umount_flags[] = {
+       { MNT_FORCE,    "MNT_FORCE"     },
+       { MNT_DETACH,   "MNT_DETACH"    },
+       { MNT_EXPIRE,   "MNT_EXPIRE"    },
+       { 0,            NULL            },
+};
+
 int
-sys_umount2(tcp)
-struct tcb *tcp;
+sys_umount2(struct tcb *tcp)
 {
        if (entering(tcp)) {
                printstr(tcp, tcp->u_arg[0], -1);
                tprintf(", ");
-               if (tcp->u_arg[1] & 1)
-                       tprintf("MNT_FORCE");
-               else
-                       tprintf("0");
+               printflags(umount_flags, tcp->u_arg[1], "MNT_???");
        }
        return 0;
 }