From 5c7ad8c9155271b3c7b8fc9f08da43d3d9138b71 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sat, 13 Jan 2007 11:15:48 +0000 Subject: [PATCH] 2007-01-11 Dmitry V. Levin 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 | 5 +++++ system.c | 19 +++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index ecab1df2..4ab49ca2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2007-01-11 Dmitry V. Levin + 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. diff --git a/system.c b/system.c index 5752f4f8..0970d710 100644 --- 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; } -- 2.40.0