Skip to content

Commit a4d4572

Browse files
committed
chmod.c: make use of RVAL_DECODED
* chmod.c (decode_chmod): Change to return void. (sys_chmod, sys_fchmodat): Update callers. Update for RVAL_DECODED. (sys_fchmod): Update for RVAL_DECODED.
1 parent 10e407d commit a4d4572

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

chmod.c

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
11
#include "defs.h"
22

3-
static int
4-
decode_chmod(struct tcb *tcp, int offset)
3+
static void
4+
decode_chmod(struct tcb *tcp, const int offset)
55
{
6-
if (entering(tcp)) {
7-
printpath(tcp, tcp->u_arg[offset]);
8-
tprintf(", %#lo", tcp->u_arg[offset + 1]);
9-
}
10-
return 0;
6+
printpath(tcp, tcp->u_arg[offset]);
7+
tprintf(", %#lo", tcp->u_arg[offset + 1]);
118
}
129

1310
SYS_FUNC(chmod)
1411
{
15-
return decode_chmod(tcp, 0);
12+
decode_chmod(tcp, 0);
13+
14+
return RVAL_DECODED;
1615
}
1716

1817
SYS_FUNC(fchmodat)
1918
{
20-
if (entering(tcp))
21-
print_dirfd(tcp, tcp->u_arg[0]);
22-
return decode_chmod(tcp, 1);
19+
print_dirfd(tcp, tcp->u_arg[0]);
20+
decode_chmod(tcp, 1);
21+
22+
return RVAL_DECODED;
2323
}
2424

2525
SYS_FUNC(fchmod)
2626
{
27-
if (entering(tcp)) {
28-
printfd(tcp, tcp->u_arg[0]);
29-
tprintf(", %#lo", tcp->u_arg[1]);
30-
}
31-
return 0;
27+
printfd(tcp, tcp->u_arg[0]);
28+
tprintf(", %#lo", tcp->u_arg[1]);
29+
30+
return RVAL_DECODED;
3231
}

0 commit comments

Comments
 (0)