]> granicus.if.org Git - strace/commitdiff
xlat: merge fcntl64cmds into fcntlcmds
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 2 May 2018 15:23:46 +0000 (15:23 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 3 May 2018 00:09:53 +0000 (00:09 +0000)
Since we don't have to workaround old F_[GS]ETOWN_EX == F_[SG]ETLK64
kernel bug any longer, there is a room for cleanup.

* xlat/fcntlcmds.in (F_GETLK64, F_SETLK64, F_SETLKW64): Add from
xlat/fcntl64cmds.in.
* xlat/fcntl64cmds.in: Remove.
* fcntl.c: Do not include "xlat/fcntl64cmds.h".
(SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): Do not use fcntl64cmds, call
printxval instead of printxvals.

fcntl.c
xlat/fcntl64cmds.in [deleted file]
xlat/fcntlcmds.in

diff --git a/fcntl.c b/fcntl.c
index 3abce7fd779906cf7294d5c9ef011d1a8e66eeb7..fc3ffb4f8337e8921dcdbe03ee9fde9aee54dd6e 100644 (file)
--- a/fcntl.c
+++ b/fcntl.c
@@ -35,7 +35,6 @@
 #include "xlat/f_owner_types.h"
 #include "xlat/f_seals.h"
 #include "xlat/fcntlcmds.h"
-#include "xlat/fcntl64cmds.h"
 #include "xlat/fdflags.h"
 #include "xlat/lockfcmds.h"
 #include "xlat/notifyflags.h"
@@ -197,14 +196,7 @@ SYS_FUNC(fcntl)
        if (entering(tcp)) {
                printfd(tcp, tcp->u_arg[0]);
                tprints(", ");
-               const unsigned int cmd = tcp->u_arg[1];
-
-               /*
-                * fcntl syscall does not recognize fcntl64 command constants,
-                * but we would like to show them for better debugging
-                * experience.
-                */
-               printxvals(cmd, "F_???", fcntlcmds, fcntl64cmds, NULL);
+               printxval(fcntlcmds, tcp->u_arg[1], "F_???");
        }
        return print_fcntl(tcp);
 }
@@ -215,7 +207,7 @@ SYS_FUNC(fcntl64)
        if (entering(tcp)) {
                printfd(tcp, tcp->u_arg[0]);
                tprints(", ");
-               printxvals(cmd, "F_???", fcntl64cmds, fcntlcmds, NULL);
+               printxval(fcntlcmds, cmd, "F_???");
        }
        switch (cmd) {
                case F_SETLK64:
diff --git a/xlat/fcntl64cmds.in b/xlat/fcntl64cmds.in
deleted file mode 100644 (file)
index afed213..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/* asm-generic/fcntl.h */
-#if defined __hppa__
-F_GETLK64      8
-F_SETLK64      9
-F_SETLKW64     10
-#elif defined __mips__
-F_GETLK64      33
-F_SETLK64      34
-F_SETLKW64     35
-#else
-F_GETLK64      12
-F_SETLK64      13
-F_SETLKW64     14
-#endif
index 56032ce3a22c49ebe8303ee8feed3d2113f47ed1..3fceea2eaf4f597b1f4fb94b7b786c484dc974fd 100644 (file)
@@ -46,6 +46,20 @@ F_SETSIG     10
 F_GETSIG       11
 #endif
 
+#if defined __hppa__
+F_GETLK64      8
+F_SETLK64      9
+F_SETLKW64     10
+#elif defined __mips__
+F_GETLK64      33
+F_SETLK64      34
+F_SETLKW64     35
+#else
+F_GETLK64      12
+F_SETLK64      13
+F_SETLKW64     14
+#endif
+
 #ifndef STRACE_WORKAROUND_FOR_F_OWNER_EX
 # define STRACE_WORKAROUND_FOR_F_OWNER_EX
 /*