From ef08ed1a035814b012cf5de41c837e91f993f5bf Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sun, 19 Jul 2015 23:00:35 +0000 Subject: [PATCH] mount.c: make use of RVAL_DECODED * mount.c (sys_mount): Update for RVAL_DECODED. --- mount.c | 87 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 43 insertions(+), 44 deletions(-) diff --git a/mount.c b/mount.c index b096c536..51c7b3e4 100644 --- a/mount.c +++ b/mount.c @@ -7,49 +7,48 @@ SYS_FUNC(mount) { - if (entering(tcp)) { - bool ignore_type = false; - bool ignore_data = false; - bool old_magic = false; - unsigned long flags = tcp->u_arg[3]; - - /* Discard magic */ - if ((flags & MS_MGC_MSK) == MS_MGC_VAL) { - flags &= ~MS_MGC_MSK; - old_magic = true; - } - - if (flags & MS_REMOUNT) - ignore_type = true; - else if (flags & (MS_BIND | MS_MOVE | MS_SHARED - | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE)) - ignore_type = ignore_data = true; - - printpath(tcp, tcp->u_arg[0]); - tprints(", "); - - printpath(tcp, tcp->u_arg[1]); - tprints(", "); - - if (ignore_type) - printaddr(tcp->u_arg[2]); - else - printstr(tcp, tcp->u_arg[2], -1); - tprints(", "); - - if (old_magic) { - tprints("MS_MGC_VAL"); - if (flags) - tprints("|"); - } - if (flags || !old_magic) - printflags(mount_flags, flags, "MS_???"); - tprints(", "); - - if (ignore_data) - printaddr(tcp->u_arg[4]); - else - printstr(tcp, tcp->u_arg[4], -1); + bool ignore_type = false; + bool ignore_data = false; + bool old_magic = false; + unsigned long flags = tcp->u_arg[3]; + + /* Discard magic */ + if ((flags & MS_MGC_MSK) == MS_MGC_VAL) { + flags &= ~MS_MGC_MSK; + old_magic = true; } - return 0; + + if (flags & MS_REMOUNT) + ignore_type = true; + else if (flags & (MS_BIND | MS_MOVE | MS_SHARED + | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE)) + ignore_type = ignore_data = true; + + printpath(tcp, tcp->u_arg[0]); + tprints(", "); + + printpath(tcp, tcp->u_arg[1]); + tprints(", "); + + if (ignore_type) + printaddr(tcp->u_arg[2]); + else + printstr(tcp, tcp->u_arg[2], -1); + tprints(", "); + + if (old_magic) { + tprints("MS_MGC_VAL"); + if (flags) + tprints("|"); + } + if (flags || !old_magic) + printflags(mount_flags, flags, "MS_???"); + tprints(", "); + + if (ignore_data) + printaddr(tcp->u_arg[4]); + else + printstr(tcp, tcp->u_arg[4], -1); + + return RVAL_DECODED; } -- 2.50.1