Browse Source

file.c: move getcwd parser to a separate file

* getcwd.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* file.c (sys_getcwd): Move to getcwd.c.
Dmitry V. Levin 5 years ago
parent
commit
a836430dbb
3 changed files with 15 additions and 13 deletions
  1. 1
    0
      Makefile.am
  2. 0
    13
      file.c
  3. 14
    0
      getcwd.c

+ 1
- 0
Makefile.am View File

@@ -29,6 +29,7 @@ strace_SOURCES =	\
29 29
 	fallocate.c	\
30 30
 	fanotify.c	\
31 31
 	file.c		\
32
+	getcwd.c	\
32 33
 	inotify.c	\
33 34
 	io.c		\
34 35
 	ioctl.c		\

+ 0
- 13
file.c View File

@@ -1668,16 +1668,3 @@ sys_mknodat(struct tcb *tcp)
1668 1668
 		print_dirfd(tcp, tcp->u_arg[0]);
1669 1669
 	return decode_mknod(tcp, 1);
1670 1670
 }
1671
-
1672
-int
1673
-sys_getcwd(struct tcb *tcp)
1674
-{
1675
-	if (exiting(tcp)) {
1676
-		if (syserror(tcp))
1677
-			tprintf("%#lx", tcp->u_arg[0]);
1678
-		else
1679
-			printpathn(tcp, tcp->u_arg[0], tcp->u_rval - 1);
1680
-		tprintf(", %lu", tcp->u_arg[1]);
1681
-	}
1682
-	return 0;
1683
-}

+ 14
- 0
getcwd.c View File

@@ -0,0 +1,14 @@
1
+#include "defs.h"
2
+
3
+int
4
+sys_getcwd(struct tcb *tcp)
5
+{
6
+	if (exiting(tcp)) {
7
+		if (syserror(tcp))
8
+			tprintf("%#lx", tcp->u_arg[0]);
9
+		else
10
+			printpathn(tcp, tcp->u_arg[0], tcp->u_rval - 1);
11
+		tprintf(", %lu", tcp->u_arg[1]);
12
+	}
13
+	return 0;
14
+}

Loading…
Cancel
Save