]> granicus.if.org Git - strace/blobdiff - chmod.c
Fix the length argument passed from print_iovec to decode_netlink
[strace] / chmod.c
diff --git a/chmod.c b/chmod.c
index 21ce11549f86a18a6938936d6cab31817aae29fe..fd76490c08031f87ba340839b2fa7bcb8140cf23 100644 (file)
--- a/chmod.c
+++ b/chmod.c
@@ -1,32 +1,33 @@
 #include "defs.h"
 
-static int
-decode_chmod(struct tcb *tcp, int offset)
+static void
+decode_chmod(struct tcb *tcp, const int offset)
 {
-       if (entering(tcp)) {
-               printpath(tcp, tcp->u_arg[offset]);
-               tprintf(", %#lo", tcp->u_arg[offset + 1]);
-       }
-       return 0;
+       printpath(tcp, tcp->u_arg[offset]);
+       tprints(", ");
+       print_numeric_umode_t(tcp->u_arg[offset + 1]);
 }
 
 SYS_FUNC(chmod)
 {
-       return decode_chmod(tcp, 0);
+       decode_chmod(tcp, 0);
+
+       return RVAL_DECODED;
 }
 
 SYS_FUNC(fchmodat)
 {
-       if (entering(tcp))
-               print_dirfd(tcp, tcp->u_arg[0]);
-       return decode_chmod(tcp, 1);
+       print_dirfd(tcp, tcp->u_arg[0]);
+       decode_chmod(tcp, 1);
+
+       return RVAL_DECODED;
 }
 
 SYS_FUNC(fchmod)
 {
-       if (entering(tcp)) {
-               printfd(tcp, tcp->u_arg[0]);
-               tprintf(", %#lo", tcp->u_arg[1]);
-       }
-       return 0;
+       printfd(tcp, tcp->u_arg[0]);
+       tprints(", ");
+       print_numeric_umode_t(tcp->u_arg[1]);
+
+       return RVAL_DECODED;
 }