]> granicus.if.org Git - strace/commitdiff
Move personality parser to a separate file
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 3 Dec 2014 21:06:11 +0000 (21:06 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 4 Dec 2014 02:23:40 +0000 (02:23 +0000)
* personality.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* system.c: Move sys_personality and related code to personality.c.

Makefile.am
personality.c [new file with mode: 0644]
system.c

index a87f4a529156fca3de26e815f0c826063ec80ae3..707f486080b7d38b91721798d0daf2481adbf6f1 100644 (file)
@@ -41,6 +41,7 @@ strace_SOURCES =      \
        net.c           \
        or1k_atomic.c   \
        pathtrace.c     \
+       personality.c   \
        process.c       \
        ptp.c           \
        quota.c         \
diff --git a/personality.c b/personality.c
new file mode 100644 (file)
index 0000000..a90d7dd
--- /dev/null
@@ -0,0 +1,13 @@
+#include "defs.h"
+
+#include <linux/personality.h>
+
+#include "xlat/personality_options.h"
+
+int
+sys_personality(struct tcb *tcp)
+{
+       if (entering(tcp))
+               printxval(personality_options, tcp->u_arg[0], "PER_???");
+       return 0;
+}
index 7e1ab72ae3f68ead4cb3eafc71a86010744539ee..91a471bc5c2cdecbc1a8feb20e8a48ee131a9a5b 100644 (file)
--- a/system.c
+++ b/system.c
@@ -60,8 +60,6 @@
 #define MS_MGC_VAL     0xc0ed0000      /* Magic flag number */
 #define MS_MGC_MSK     0xffff0000      /* Magic flag mask */
 
-#include <linux/personality.h>
-
 #include "xlat/mount_flags.h"
 
 int
@@ -119,15 +117,3 @@ sys_umount2(struct tcb *tcp)
        }
        return 0;
 }
-
-/* These are not macros, but enums.  We just copy the values by hand
-   from Linux 2.6.9 here.  */
-#include "xlat/personality_options.h"
-
-int
-sys_personality(struct tcb *tcp)
-{
-       if (entering(tcp))
-               printxval(personality_options, tcp->u_arg[0], "PER_???");
-       return 0;
-}