]> granicus.if.org Git - strace/commitdiff
Move umoven_or_printaddr_ignore_syserror to util.c
authorEugene Syromyatnikov <evgsyr@gmail.com>
Fri, 14 Oct 2016 23:27:21 +0000 (02:27 +0300)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 28 Oct 2016 18:40:10 +0000 (18:40 +0000)
* defs.h (umoven_or_printaddr_ignore_syserror): New prototype.
* v4l2.c (umoven_or_printaddr_ignore_syserror): Move ...
* util.c: ... here.

defs.h
util.c
v4l2.c

diff --git a/defs.h b/defs.h
index 758fd8b914b11c7dad2ac68d46f48a378a5757af..63e5e93cf0c75ad819f70ebd82d9563bb03e8238 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -478,6 +478,9 @@ extern int umoven(struct tcb *, long, unsigned int, void *);
 extern int umoven_or_printaddr(struct tcb *, long, unsigned int, void *);
 #define umove_or_printaddr(pid, addr, objp)    \
        umoven_or_printaddr((pid), (addr), sizeof(*(objp)), (void *) (objp))
+extern int
+umoven_or_printaddr_ignore_syserror(struct tcb *tcp, const long addr,
+                                   const unsigned int len, void *our_addr);
 extern int umovestr(struct tcb *, long, unsigned int, char *);
 extern int upeek(int pid, long, long *);
 
diff --git a/util.c b/util.c
index 23a5fdbfd04907112dfe1421e4608dd3db7e73ca..99e8e2e62fc8962888a1cb51899a1b5bc8a61bfe 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1156,6 +1156,17 @@ umoven_or_printaddr(struct tcb *tcp, const long addr, const unsigned int len,
        return 0;
 }
 
+int
+umoven_or_printaddr_ignore_syserror(struct tcb *tcp, const long addr,
+                                   const unsigned int len, void *our_addr)
+{
+       if (!addr || !verbose(tcp) || umoven(tcp, addr, len, our_addr) < 0) {
+               printaddr(addr);
+               return -1;
+       }
+       return 0;
+}
+
 /*
  * Like `umove' but make the additional effort of looking
  * for a terminating zero byte.
diff --git a/v4l2.c b/v4l2.c
index aadc3378144e78418be4c050e29355e233c40899..c204fe5ba26e715f68413cc320268fb2d89036f8 100644 (file)
--- a/v4l2.c
+++ b/v4l2.c
@@ -675,17 +675,6 @@ print_v4l2_ext_control(struct tcb *tcp, void *elem_buf, size_t elem_size, void *
 
 #include "xlat/v4l2_control_classes.h"
 
-static int
-umoven_or_printaddr_ignore_syserror(struct tcb *tcp, const long addr,
-                                   const unsigned int len, void *our_addr)
-{
-       if (!addr || !verbose(tcp) || umoven(tcp, addr, len, our_addr) < 0) {
-               printaddr(addr);
-               return -1;
-       }
-       return 0;
-}
-
 static int
 print_v4l2_ext_controls(struct tcb *tcp, const long arg, const bool is_get)
 {