]> granicus.if.org Git - strace/blob - chmod.c
Fix preprocessor indentation
[strace] / chmod.c
1 /*
2  * Copyright (c) 2014-2019 The strace developers.
3  * All rights reserved.
4  *
5  * SPDX-License-Identifier: LGPL-2.1-or-later
6  */
7
8 #include "defs.h"
9
10 static void
11 decode_chmod(struct tcb *tcp, const int offset)
12 {
13         printpath(tcp, tcp->u_arg[offset]);
14         tprints(", ");
15         print_numeric_umode_t(tcp->u_arg[offset + 1]);
16 }
17
18 SYS_FUNC(chmod)
19 {
20         decode_chmod(tcp, 0);
21
22         return RVAL_DECODED;
23 }
24
25 SYS_FUNC(fchmodat)
26 {
27         print_dirfd(tcp, tcp->u_arg[0]);
28         tprints(", ");
29         decode_chmod(tcp, 1);
30
31         return RVAL_DECODED;
32 }
33
34 SYS_FUNC(fchmod)
35 {
36         printfd(tcp, tcp->u_arg[0]);
37         tprints(", ");
38         print_numeric_umode_t(tcp->u_arg[1]);
39
40         return RVAL_DECODED;
41 }