aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2022-09-18 21:45:50 +0200
committerLaurent Vivier <laurent@vivier.eu>2022-09-27 09:29:33 +0200
commit105d599a33462bd64529bc3bacc68e2d0fbb876b (patch)
tree0f991154a027732b2e71ce783a0f7b2fd58df793 /linux-user
parent770525f8eac9a2d048896fd54e4c596af747f238 (diff)
downloadqemu-105d599a33462bd64529bc3bacc68e2d0fbb876b.zip
qemu-105d599a33462bd64529bc3bacc68e2d0fbb876b.tar.gz
qemu-105d599a33462bd64529bc3bacc68e2d0fbb876b.tar.bz2
linux-user: Fix strace of chmod() if mode == 0
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>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/strace.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/linux-user/strace.c b/linux-user/strace.c
index 5ac64df..2f53984 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -1505,6 +1505,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);