45 lines
1.4 KiB
Diff
45 lines
1.4 KiB
Diff
|
|
From 6b8ad93d212b5510140b49b1383626ec6dae9427 Mon Sep 17 00:00:00 2001
|
||
|
|
From: =?UTF-8?q?=E5=88=98=E5=A9=A720201110?=
|
||
|
|
<liujing_yewu@cmss.chinamobile.com>
|
||
|
|
Date: Wed, 13 Nov 2024 20:06:25 +0800
|
||
|
|
Subject: [PATCH] linux-user: Fix strace of chmod() if mode == 0
|
||
|
|
MIME-Version: 1.0
|
||
|
|
Content-Type: text/plain; charset=UTF-8
|
||
|
|
Content-Transfer-Encoding: 8bit
|
||
|
|
|
||
|
|
If the mode parameter of chmod() is zero, this value isn't shown
|
||
|
|
when stracing a program:
|
||
|
|
chmod("filename",)
|
||
|
|
This patch fixes it up to show the zero-value as well:
|
||
|
|
chmod("filename",000)
|
||
|
|
|
||
|
|
Signed-off-by: Helge Deller <deller@gmx.de>
|
||
|
|
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
|
||
|
|
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
|
||
|
|
Message-Id: <20220918194555.83535-8-deller@gmx.de>
|
||
|
|
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
|
||
|
|
Signed-off-by: Liu Jing <liujing_yewu@cmss.chinamobile.com>
|
||
|
|
---
|
||
|
|
linux-user/strace.c | 5 +++++
|
||
|
|
1 file changed, 5 insertions(+)
|
||
|
|
|
||
|
|
diff --git a/linux-user/strace.c b/linux-user/strace.c
|
||
|
|
index 37d66d0dff..a6e269980f 100644
|
||
|
|
--- a/linux-user/strace.c
|
||
|
|
+++ b/linux-user/strace.c
|
||
|
|
@@ -1496,6 +1496,11 @@ print_file_mode(abi_long mode, int last)
|
||
|
|
const char *sep = "";
|
||
|
|
const struct flags *m;
|
||
|
|
|
||
|
|
+ if (mode == 0) {
|
||
|
|
+ qemu_log("000%s", get_comma(last));
|
||
|
|
+ return;
|
||
|
|
+ }
|
||
|
|
+
|
||
|
|
for (m = &mode_flags[0]; m->f_string != NULL; m++) {
|
||
|
|
if ((m->f_value & mode) == m->f_value) {
|
||
|
|
qemu_log("%s%s", m->f_string, sep);
|
||
|
|
--
|
||
|
|
2.41.0.windows.1
|
||
|
|
|