mknod.c: make use of RVAL_DECODED

* mknod.c (decode_mknod): Change to return void.
Update for RVAL_DECODED.
(sys_mknod, sys_mknodat): Update callers.  Update for RVAL_DECODED.
[SPARC || SPARC64] (xmknod): Update for RVAL_DECODED.
This commit is contained in:
Дмитрий Левин 2015-07-19 23:07:17 +00:00
parent ef08ed1a03
commit c15dd41453

75
mknod.c
View File

@ -11,45 +11,43 @@
# include <sys/mkdev.h>
#endif
static int
static void
decode_mknod(struct tcb *tcp, int offset)
{
int mode = tcp->u_arg[offset + 1];
if (entering(tcp)) {
printpath(tcp, tcp->u_arg[offset]);
tprintf(", %s", sprintmode(mode));
switch (mode & S_IFMT) {
case S_IFCHR:
case S_IFBLK:
printpath(tcp, tcp->u_arg[offset]);
tprintf(", %s", sprintmode(mode));
switch (mode & S_IFMT) {
case S_IFCHR:
case S_IFBLK:
#if defined(SPARC) || defined(SPARC64)
if (current_personality == 1)
tprintf(", makedev(%lu, %lu)",
(unsigned long) ((tcp->u_arg[offset + 2] >> 18) & 0x3fff),
(unsigned long) (tcp->u_arg[offset + 2] & 0x3ffff));
else
if (current_personality == 1)
tprintf(", makedev(%lu, %lu)",
(unsigned long) ((tcp->u_arg[offset + 2] >> 18) & 0x3fff),
(unsigned long) (tcp->u_arg[offset + 2] & 0x3ffff));
else
#endif /* SPARC || SPARC64 */
tprintf(", makedev(%lu, %lu)",
(unsigned long) major(tcp->u_arg[offset + 2]),
(unsigned long) minor(tcp->u_arg[offset + 2]));
break;
default:
break;
}
tprintf(", makedev(%lu, %lu)",
(unsigned long) major(tcp->u_arg[offset + 2]),
(unsigned long) minor(tcp->u_arg[offset + 2]));
break;
}
return 0;
}
SYS_FUNC(mknod)
{
return decode_mknod(tcp, 0);
decode_mknod(tcp, 0);
return RVAL_DECODED;
}
SYS_FUNC(mknodat)
{
if (entering(tcp))
print_dirfd(tcp, tcp->u_arg[0]);
return decode_mknod(tcp, 1);
print_dirfd(tcp, tcp->u_arg[0]);
decode_mknod(tcp, 1);
return RVAL_DECODED;
}
#if defined(SPARC) || defined(SPARC64)
@ -57,21 +55,20 @@ SYS_FUNC(xmknod)
{
int mode = tcp->u_arg[2];
if (entering(tcp)) {
tprintf("%ld, ", tcp->u_arg[0]);
printpath(tcp, tcp->u_arg[1]);
tprintf(", %s", sprintmode(mode));
switch (mode & S_IFMT) {
case S_IFCHR:
case S_IFBLK:
tprintf(", makedev(%lu, %lu)",
(unsigned long) ((tcp->u_arg[3] >> 18) & 0x3fff),
(unsigned long) (tcp->u_arg[3] & 0x3ffff));
break;
default:
break;
}
tprintf("%ld, ", tcp->u_arg[0]);
printpath(tcp, tcp->u_arg[1]);
tprintf(", %s", sprintmode(mode));
switch (mode & S_IFMT) {
case S_IFCHR:
case S_IFBLK:
tprintf(", makedev(%lu, %lu)",
(unsigned long) ((tcp->u_arg[3] >> 18) & 0x3fff),
(unsigned long) (tcp->u_arg[3] & 0x3ffff));
break;
default:
break;
}
return 0;
return RVAL_DECODED;
}
#endif /* SPARC || SPARC64 */