printpath*: change address argument type from long to kernel_ureg_t

* defs.h (printpath, printpathn): Change address argument type
from long to kernel_ureg_t.
* util.c (printpath, printpathn): Likewise.
This commit is contained in:
Дмитрий Левин 2016-12-20 22:06:34 +00:00
parent 5e4019c3bc
commit 78b02c928a
2 changed files with 8 additions and 4 deletions

8
defs.h
View File

@ -651,8 +651,12 @@ DECL_PRINTPAIR(int);
DECL_PRINTPAIR(int64);
#undef DECL_PRINTPAIR
extern void printpath(struct tcb *, long);
extern void printpathn(struct tcb *, long, unsigned int);
extern void
printpathn(struct tcb *, kernel_ureg_t addr, unsigned int n);
extern void
printpath(struct tcb *, kernel_ureg_t addr);
#define TIMESPEC_TEXT_BUFSIZE \
(sizeof(intmax_t)*3 * 2 + sizeof("{tv_sec=%jd, tv_nsec=%jd}"))
extern void printfd(struct tcb *, int);

4
util.c
View File

@ -813,7 +813,7 @@ print_quoted_string(const char *str, unsigned int size,
* If path length exceeds `n', append `...' to the output.
*/
void
printpathn(struct tcb *tcp, long addr, unsigned int n)
printpathn(struct tcb *const tcp, const kernel_ureg_t addr, unsigned int n)
{
char path[PATH_MAX + 1];
int nul_seen;
@ -840,7 +840,7 @@ printpathn(struct tcb *tcp, long addr, unsigned int n)
}
void
printpath(struct tcb *tcp, long addr)
printpath(struct tcb *const tcp, const kernel_ureg_t addr)
{
/* Size must correspond to char path[] size in printpathn */
printpathn(tcp, addr, PATH_MAX);