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.
This commit is contained in:
parent
b0c4a35ac1
commit
a980c9ebbd
3
defs.h
3
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 *);
|
||||
|
||||
|
11
util.c
11
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.
|
||||
|
11
v4l2.c
11
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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user