* defs.h (umoven_or_printaddr_ignore_syserror): New declaration. * v4l2.c (umoven_or_printaddr_ignore_syserror): Move it ... * util.c (umoven_or_printaddr_ignore_syserror): ... here. --- defs.h | 3 +++ util.c | 11 +++++++++++ v4l2.c | 11 ----------- 3 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/defs.h b/defs.h index 1bc83fd..6566488 100644 --- 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 00148d4..e580eb2 100644 --- a/util.c +++ b/util.c @@ -1168,6 +1168,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 aadc337..c204fe5 100644 --- a/v4l2.c +++ b/v4l2.c @@ -676,17 +676,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) { struct_v4l2_ext_controls c; -- 1.7.10.4 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Strace-devel mailing list Strace-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/strace-devel