]> granicus.if.org Git - strace/commitdiff
syslog.c: use umove_or_printaddr and RVAL_DECODED
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 16 Jul 2015 23:11:23 +0000 (23:11 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 16 Jul 2015 23:44:57 +0000 (23:44 +0000)
* sysctl.c (sys_sysctl): Use umove_or_printaddr and RVAL_DECODED.

sysctl.c

index 03d7b1c89906138dbbd54d26e3fe0722fab53fcf..1250ef4fb10ff9e4c0a7980a3e77145437ba9074 100644 (file)
--- a/sysctl.c
+++ b/sysctl.c
@@ -20,8 +20,8 @@ SYS_FUNC(sysctl)
        int *name;
        unsigned long size;
 
-       if (umove(tcp, tcp->u_arg[0], &info) < 0)
-               return printargs(tcp);
+       if (umove_or_printaddr(tcp, tcp->u_arg[0], &info))
+               return RVAL_DECODED;
 
        size = sizeof(int) * (unsigned long) info.nlen;
        name = (size / sizeof(int) != (unsigned long) info.nlen) ? NULL : malloc(size);
@@ -32,7 +32,7 @@ SYS_FUNC(sysctl)
                        tprintf("{%p, %d, %p, %p, %p, %lu}",
                                info.name, info.nlen, info.oldval,
                                info.oldlenp, info.newval, (unsigned long)info.newlen);
-               return 0;
+               return RVAL_DECODED;
        }
 
        if (entering(tcp)) {