]> granicus.if.org Git - strace/commitdiff
file.c: move fallocate parser to a separate file
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 6 Dec 2014 03:53:16 +0000 (03:53 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 11 Dec 2014 21:38:25 +0000 (21:38 +0000)
* fallocate.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* file.c (sys_fallocate): Move to fallocate.c.

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

index d250125f0f6730a1dce1049ad0bf9f3d86079709..f4e7c77558275939a5c587642de0d592e68b3fb2 100644 (file)
@@ -25,6 +25,7 @@ strace_SOURCES =      \
        count.c         \
        desc.c          \
        dirent.c        \
+       fallocate.c     \
        fanotify.c      \
        file.c          \
        inotify.c       \
diff --git a/fallocate.c b/fallocate.c
new file mode 100644 (file)
index 0000000..c906cc5
--- /dev/null
@@ -0,0 +1,14 @@
+#include "defs.h"
+
+int
+sys_fallocate(struct tcb *tcp)
+{
+       if (entering(tcp)) {
+               int argn;
+               printfd(tcp, tcp->u_arg[0]);            /* fd */
+               tprintf(", %#lo, ", tcp->u_arg[1]);     /* mode */
+               argn = printllval(tcp, "%llu, ", 2);    /* offset */
+               printllval(tcp, "%llu", argn);          /* len */
+       }
+       return 0;
+}
diff --git a/file.c b/file.c
index d748db7b83497ab4ed969d93b64de077a4419bf0..70050ffcfc798ea5de8d4058e5223c2d4e699c6c 100644 (file)
--- a/file.c
+++ b/file.c
@@ -1913,16 +1913,3 @@ sys_sync_file_range2(struct tcb *tcp)
        }
        return 0;
 }
-
-int
-sys_fallocate(struct tcb *tcp)
-{
-       if (entering(tcp)) {
-               int argn;
-               printfd(tcp, tcp->u_arg[0]);            /* fd */
-               tprintf(", %#lo, ", tcp->u_arg[1]);     /* mode */
-               argn = printllval(tcp, "%llu, ", 2);    /* offset */
-               printllval(tcp, "%llu", argn);          /* len */
-       }
-       return 0;
-}