file.c: group related parsers together
* file.c (sys_stat, sys_fstat): Collect in one place right before the definition of printstat64. (sys_stat64, sys_fstat64): Collect in one place right after the definition of printstat64.
This commit is contained in:
parent
1fb1c13910
commit
c6ee0ecb5a
80
file.c
80
file.c
@ -356,6 +356,30 @@ printstat(struct tcb *tcp, long addr)
|
||||
do_printstat(tcp, &statbuf);
|
||||
}
|
||||
|
||||
int
|
||||
sys_stat(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprints(", ");
|
||||
} else {
|
||||
printstat(tcp, tcp->u_arg[1]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
sys_fstat(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprints(", ");
|
||||
} else {
|
||||
printstat(tcp, tcp->u_arg[1]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if !defined HAVE_STAT64 && (defined AARCH64 || defined X86_64 || defined X32)
|
||||
/*
|
||||
* Linux x86_64 and x32 have unified `struct stat' but their i386 personality
|
||||
@ -459,18 +483,6 @@ printstat64(struct tcb *tcp, long addr)
|
||||
}
|
||||
#endif /* HAVE_STAT64 */
|
||||
|
||||
int
|
||||
sys_stat(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printpath(tcp, tcp->u_arg[0]);
|
||||
tprints(", ");
|
||||
} else {
|
||||
printstat(tcp, tcp->u_arg[1]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
sys_stat64(struct tcb *tcp)
|
||||
{
|
||||
@ -487,6 +499,22 @@ sys_stat64(struct tcb *tcp)
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
sys_fstat64(struct tcb *tcp)
|
||||
{
|
||||
#ifdef HAVE_STAT64
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprints(", ");
|
||||
} else {
|
||||
printstat64(tcp, tcp->u_arg[1]);
|
||||
}
|
||||
return 0;
|
||||
#else
|
||||
return printargs(tcp);
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
sys_newfstatat(struct tcb *tcp)
|
||||
{
|
||||
@ -511,34 +539,6 @@ sys_newfstatat(struct tcb *tcp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
sys_fstat(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprints(", ");
|
||||
} else {
|
||||
printstat(tcp, tcp->u_arg[1]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
sys_fstat64(struct tcb *tcp)
|
||||
{
|
||||
#ifdef HAVE_STAT64
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprints(", ");
|
||||
} else {
|
||||
printstat64(tcp, tcp->u_arg[1]);
|
||||
}
|
||||
return 0;
|
||||
#else
|
||||
return printargs(tcp);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(HAVE_STRUCT___OLD_KERNEL_STAT)
|
||||
|
||||
static void
|
||||
|
Loading…
x
Reference in New Issue
Block a user