]> granicus.if.org Git - strace/commitdiff
Merge two identical tables
authorDenys Vlasenko <vda.linux@googlemail.com>
Sun, 17 Feb 2013 13:31:55 +0000 (14:31 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 17 Feb 2013 13:31:55 +0000 (14:31 +0100)
* defs.h: Declare whence_codes[].
* desc.c: Delete static whence[].
(printflock[64]): Use whence_codes.
* file.c: Make whence_codes[] non-static.
Add SEEK_DATA and SEEK_HOLE to them.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
defs.h
desc.c
file.c

diff --git a/defs.h b/defs.h
index 3d5f3000d0698cff858f5f581989bc0299046e26..a349036ad90dc35db1d257ae7b15fbb89ca1ff95 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -475,6 +475,7 @@ extern const struct xlat open_mode_flags[];
 extern const struct xlat addrfams[];
 extern const struct xlat struct_user_offsets[];
 extern const struct xlat open_access_modes[];
+extern const struct xlat whence_codes[];
 
 /* Format of syscall return values */
 #define RVAL_DECIMAL   000     /* decimal format */
diff --git a/desc.c b/desc.c
index 9870e9cb5a8e24b8c727be6610ea3cf15fde5c82..65e5ed061a4a0ad465ae888f08d96883ba6b7543 100644 (file)
--- a/desc.c
+++ b/desc.c
@@ -218,13 +218,6 @@ static const struct xlat notifyflags[] = {
 };
 #endif
 
-static const struct xlat whence[] = {
-       { SEEK_SET,     "SEEK_SET"      },
-       { SEEK_CUR,     "SEEK_CUR"      },
-       { SEEK_END,     "SEEK_END"      },
-       { 0,            NULL            },
-};
-
 static const struct xlat perf_event_open_flags[] = {
 #ifdef PERF_FLAG_FD_NO_GROUP
        { PERF_FLAG_FD_NO_GROUP,        "PERF_FLAG_FD_NO_GROUP" },
@@ -282,7 +275,7 @@ printflock(struct tcb *tcp, long addr, int getlk)
        tprints("{type=");
        printxval(lockfcmds, fl.l_type, "F_???");
        tprints(", whence=");
-       printxval(whence, fl.l_whence, "SEEK_???");
+       printxval(whence_codes, fl.l_whence, "SEEK_???");
        tprintf(", start=%ld, len=%ld", fl.l_start, fl.l_len);
        if (getlk)
                tprintf(", pid=%lu}", (unsigned long) fl.l_pid);
@@ -305,7 +298,7 @@ printflock64(struct tcb *tcp, long addr, int getlk)
        tprints("{type=");
        printxval(lockfcmds, fl.l_type, "F_???");
        tprints(", whence=");
-       printxval(whence, fl.l_whence, "SEEK_???");
+       printxval(whence_codes, fl.l_whence, "SEEK_???");
        tprintf(", start=%lld, len=%lld", (long long) fl.l_start, (long long) fl.l_len);
        if (getlk)
                tprintf(", pid=%lu}", (unsigned long) fl.l_pid);
diff --git a/file.c b/file.c
index e5354487d1fd4f1af3d1d1f80709b0abfaf784d6..bea531211cef2b6b3a28d6baf1c914ecacc81813 100644 (file)
--- a/file.c
+++ b/file.c
@@ -516,10 +516,16 @@ sys_umask(struct tcb *tcp)
        return RVAL_OCTAL;
 }
 
-static const struct xlat whence_codes[] = {
+const struct xlat whence_codes[] = {
        { SEEK_SET,     "SEEK_SET"      },
        { SEEK_CUR,     "SEEK_CUR"      },
        { SEEK_END,     "SEEK_END"      },
+#ifdef SEEK_DATA
+       { SEEK_DATA,    "SEEK_DATA"     },
+#endif
+#ifdef SEEK_HOLE
+       { SEEK_HOLE,    "SEEK_HOLE"     },
+#endif
        { 0,            NULL            },
 };