Browse Source

print_dirfd: do not print trailing comma

It was fine to print trailing comma in print_dirfd until introduction
of a syscall with the last argument being a dirfd.
Now it's time to change print_dirfd.

* open.c (print_dirfd): Do not print comma.
(SYS_FUNC(open)): Print comma after print_dirfd() invocation.
* access.c (SYS_FUNC(faccessat)): Likewise.
* chmod.c (SYS_FUNC(fchmodat)): Likewise.
* execve.c (SYS_FUNC(execveat)): Likewise.
* fanotify.c (SYS_FUNC(fanotify_mark)): Likewise.
* fchownat.c (SYS_FUNC(fchownat)): Likewise.
* file_handle.c (SYS_FUNC(name_to_handle_at)): Likewise.
* link.c (SYS_FUNC(linkat), SYS_FUNC(unlinkat), SYS_FUNC(symlinkat)):
Likewise.
* mknod.c (SYS_FUNC(mknodat)): Likewise.
* move_mount.c (SYS_FUNC(move_mount)): Likewise.
* open_tree.c (SYS_FUNC(open_tree)): Likewise.
* readlink.c (SYS_FUNC(readlinkat)): Likewise.
* renameat.c (decode_renameat): Likewise.
* stat.c (SYS_FUNC(newfstatat)): Likewise.
* stat64.c (SYS_FUNC(fstatat64)): Likewise.
* statx.c (SYS_FUNC(statx)): Likewise.
* utimes.c (SYS_FUNC(futimesat), do_utimensat): Likewise.
Dmitry V. Levin 4 months ago
parent
commit
714eb51428
17 changed files with 27 additions and 7 deletions
  1. 1
    0
      access.c
  2. 1
    0
      chmod.c
  3. 1
    0
      execve.c
  4. 3
    4
      fanotify.c
  5. 1
    0
      fchownat.c
  6. 1
    0
      file_handle.c
  7. 4
    0
      link.c
  8. 1
    0
      mknod.c
  9. 2
    0
      move_mount.c
  10. 1
    2
      open.c
  11. 1
    0
      open_tree.c
  12. 3
    1
      readlink.c
  13. 2
    0
      renameat.c
  14. 1
    0
      stat.c
  15. 1
    0
      stat64.c
  16. 1
    0
      statx.c
  17. 2
    0
      utimes.c

+ 1
- 0
access.c View File

@@ -29,5 +29,6 @@ SYS_FUNC(access)
29 29
 SYS_FUNC(faccessat)
30 30
 {
31 31
 	print_dirfd(tcp, tcp->u_arg[0]);
32
+	tprints(", ");
32 33
 	return decode_access(tcp, 1);
33 34
 }

+ 1
- 0
chmod.c View File

@@ -25,6 +25,7 @@ SYS_FUNC(chmod)
25 25
 SYS_FUNC(fchmodat)
26 26
 {
27 27
 	print_dirfd(tcp, tcp->u_arg[0]);
28
+	tprints(", ");
28 29
 	decode_chmod(tcp, 1);
29 30
 
30 31
 	return RVAL_DECODED;

+ 1
- 0
execve.c View File

@@ -109,6 +109,7 @@ SYS_FUNC(execve)
109 109
 SYS_FUNC(execveat)
110 110
 {
111 111
 	print_dirfd(tcp, tcp->u_arg[0]);
112
+	tprints(", ");
112 113
 	decode_execve(tcp, 1);
113 114
 	tprints(", ");
114 115
 	printflags(at_flags, tcp->u_arg[4], "AT_???");

+ 3
- 4
fanotify.c View File

@@ -55,12 +55,11 @@ SYS_FUNC(fanotify_mark)
55 55
 #endif
56 56
 	printflags64(fan_event_flags, mask, "FAN_???");
57 57
 	tprints(", ");
58
-	if ((int) tcp->u_arg[argn] == FAN_NOFD) {
58
+	if ((int) tcp->u_arg[argn] == FAN_NOFD)
59 59
 		print_xlat_d(FAN_NOFD);
60
-		tprints(", ");
61
-	} else {
60
+	else
62 61
 		print_dirfd(tcp, tcp->u_arg[argn]);
63
-	}
62
+	tprints(", ");
64 63
 	printpath(tcp, tcp->u_arg[argn + 1]);
65 64
 
66 65
 	return RVAL_DECODED;

+ 1
- 0
fchownat.c View File

@@ -10,6 +10,7 @@
10 10
 SYS_FUNC(fchownat)
11 11
 {
12 12
 	print_dirfd(tcp, tcp->u_arg[0]);
13
+	tprints(", ");
13 14
 	printpath(tcp, tcp->u_arg[1]);
14 15
 	printuid(", ", tcp->u_arg[2]);
15 16
 	printuid(", ", tcp->u_arg[3]);

+ 1
- 0
file_handle.c View File

@@ -27,6 +27,7 @@ SYS_FUNC(name_to_handle_at)
27 27
 	if (entering(tcp)) {
28 28
 		/* dirfd */
29 29
 		print_dirfd(tcp, tcp->u_arg[0]);
30
+		tprints(", ");
30 31
 
31 32
 		/* pathname */
32 33
 		printpath(tcp, tcp->u_arg[1]);

+ 4
- 0
link.c View File

@@ -29,9 +29,11 @@ SYS_FUNC(link)
29 29
 SYS_FUNC(linkat)
30 30
 {
31 31
 	print_dirfd(tcp, tcp->u_arg[0]);
32
+	tprints(", ");
32 33
 	printpath(tcp, tcp->u_arg[1]);
33 34
 	tprints(", ");
34 35
 	print_dirfd(tcp, tcp->u_arg[2]);
36
+	tprints(", ");
35 37
 	printpath(tcp, tcp->u_arg[3]);
36 38
 	tprints(", ");
37 39
 	printflags(at_flags, tcp->u_arg[4], "AT_???");
@@ -42,6 +44,7 @@ SYS_FUNC(linkat)
42 44
 SYS_FUNC(unlinkat)
43 45
 {
44 46
 	print_dirfd(tcp, tcp->u_arg[0]);
47
+	tprints(", ");
45 48
 	printpath(tcp, tcp->u_arg[1]);
46 49
 	tprints(", ");
47 50
 	printflags(at_flags, tcp->u_arg[2], "AT_???");
@@ -54,6 +57,7 @@ SYS_FUNC(symlinkat)
54 57
 	printpath(tcp, tcp->u_arg[0]);
55 58
 	tprints(", ");
56 59
 	print_dirfd(tcp, tcp->u_arg[1]);
60
+	tprints(", ");
57 61
 	printpath(tcp, tcp->u_arg[2]);
58 62
 
59 63
 	return RVAL_DECODED;

+ 1
- 0
mknod.c View File

@@ -46,6 +46,7 @@ SYS_FUNC(mknod)
46 46
 SYS_FUNC(mknodat)
47 47
 {
48 48
 	print_dirfd(tcp, tcp->u_arg[0]);
49
+	tprints(", ");
49 50
 	decode_mknod(tcp, 1);
50 51
 
51 52
 	return RVAL_DECODED;

+ 2
- 0
move_mount.c View File

@@ -14,9 +14,11 @@
14 14
 SYS_FUNC(move_mount)
15 15
 {
16 16
 	print_dirfd(tcp, tcp->u_arg[0]);
17
+	tprints(", ");
17 18
 	printpath(tcp, tcp->u_arg[1]);
18 19
 	tprints(", ");
19 20
 	print_dirfd(tcp, tcp->u_arg[2]);
21
+	tprints(", ");
20 22
 	printpath(tcp, tcp->u_arg[3]);
21 23
 	tprints(", ");
22 24
 	printflags(move_mount_flags, tcp->u_arg[4], "MOVE_MOUNT_???");

+ 1
- 2
open.c View File

@@ -45,8 +45,6 @@ print_dirfd(struct tcb *tcp, int fd)
45 45
 		print_xlat_d(AT_FDCWD);
46 46
 	else
47 47
 		printfd(tcp, fd);
48
-
49
-	tprints(", ");
50 48
 }
51 49
 
52 50
 /*
@@ -121,6 +119,7 @@ SYS_FUNC(open)
121 119
 SYS_FUNC(openat)
122 120
 {
123 121
 	print_dirfd(tcp, tcp->u_arg[0]);
122
+	tprints(", ");
124 123
 	return decode_open(tcp, 1);
125 124
 }
126 125
 

+ 1
- 0
open_tree.c View File

@@ -15,6 +15,7 @@
15 15
 SYS_FUNC(open_tree)
16 16
 {
17 17
 	print_dirfd(tcp, tcp->u_arg[0]);
18
+	tprints(", ");
18 19
 	printpath(tcp, tcp->u_arg[1]);
19 20
 	tprints(", ");
20 21
 	printflags(open_tree_flags, tcp->u_arg[2], "OPEN_TREE_???");

+ 3
- 1
readlink.c View File

@@ -44,7 +44,9 @@ SYS_FUNC(readlink)
44 44
 
45 45
 SYS_FUNC(readlinkat)
46 46
 {
47
-	if (entering(tcp))
47
+	if (entering(tcp)) {
48 48
 		print_dirfd(tcp, tcp->u_arg[0]);
49
+		tprints(", ");
50
+	}
49 51
 	return decode_readlink(tcp, 1);
50 52
 }

+ 2
- 0
renameat.c View File

@@ -11,9 +11,11 @@ static void
11 11
 decode_renameat(struct tcb *tcp)
12 12
 {
13 13
 	print_dirfd(tcp, tcp->u_arg[0]);
14
+	tprints(", ");
14 15
 	printpath(tcp, tcp->u_arg[1]);
15 16
 	tprints(", ");
16 17
 	print_dirfd(tcp, tcp->u_arg[2]);
18
+	tprints(", ");
17 19
 	printpath(tcp, tcp->u_arg[3]);
18 20
 }
19 21
 

+ 1
- 0
stat.c View File

@@ -44,6 +44,7 @@ SYS_FUNC(newfstatat)
44 44
 {
45 45
 	if (entering(tcp)) {
46 46
 		print_dirfd(tcp, tcp->u_arg[0]);
47
+		tprints(", ");
47 48
 		printpath(tcp, tcp->u_arg[1]);
48 49
 		tprints(", ");
49 50
 	} else {

+ 1
- 0
stat64.c View File

@@ -44,6 +44,7 @@ SYS_FUNC(fstatat64)
44 44
 {
45 45
 	if (entering(tcp)) {
46 46
 		print_dirfd(tcp, tcp->u_arg[0]);
47
+		tprints(", ");
47 48
 		printpath(tcp, tcp->u_arg[1]);
48 49
 		tprints(", ");
49 50
 	} else {

+ 1
- 0
statx.c View File

@@ -19,6 +19,7 @@ SYS_FUNC(statx)
19 19
 {
20 20
 	if (entering(tcp)) {
21 21
 		print_dirfd(tcp, tcp->u_arg[0]);
22
+		tprints(", ");
22 23
 		printpath(tcp, tcp->u_arg[1]);
23 24
 		tprints(", ");
24 25
 

+ 2
- 0
utimes.c View File

@@ -26,6 +26,7 @@ SYS_FUNC(utimes)
26 26
 SYS_FUNC(futimesat)
27 27
 {
28 28
 	print_dirfd(tcp, tcp->u_arg[0]);
29
+	tprints(", ");
29 30
 	printpath(tcp, tcp->u_arg[1]);
30 31
 	tprints(", ");
31 32
 	print_timeval_utimes(tcp, tcp->u_arg[2]);
@@ -37,6 +38,7 @@ static int
37 38
 do_utimensat(struct tcb *const tcp, const print_obj_by_addr_fn print_ts)
38 39
 {
39 40
 	print_dirfd(tcp, tcp->u_arg[0]);
41
+	tprints(", ");
40 42
 	printpath(tcp, tcp->u_arg[1]);
41 43
 	tprints(", ");
42 44
 	print_ts(tcp, tcp->u_arg[2]);

Loading…
Cancel
Save