From: Eugene Syromyatnikov Date: Fri, 14 Oct 2016 23:27:21 +0000 (+0300) Subject: Move umoven_or_printaddr_ignore_syserror to util.c X-Git-Tag: v4.15~208 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a980c9ebbd0038c4d275dd99f1e295cb3fdc9758;p=strace Move umoven_or_printaddr_ignore_syserror to util.c * defs.h (umoven_or_printaddr_ignore_syserror): New prototype. * v4l2.c (umoven_or_printaddr_ignore_syserror): Move ... * util.c: ... here. --- diff --git a/defs.h b/defs.h index 758fd8b9..63e5e93c 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 23a5fdbf..99e8e2e6 100644 --- 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 aadc3378..c204fe5b 100644 --- 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) {