]> granicus.if.org Git - strace/blobdiff - desc.c
tests: remove redundant SAMPLE_SIZE definitions
[strace] / desc.c
diff --git a/desc.c b/desc.c
index d6d50eefd5e123ae78b7cac746d0c89b71e7e46b..48824697fc090f48a4bab68177fa661c5440e86f 100644 (file)
--- a/desc.c
+++ b/desc.c
@@ -69,17 +69,17 @@ SYS_FUNC(dup3)
 }
 
 static int
-decode_select(struct tcb *const tcp, const kernel_ureg_t *const args,
-             void (*const print_tv_ts) (struct tcb *, kernel_ureg_t),
-             const char * (*const sprint_tv_ts) (struct tcb *, kernel_ureg_t))
+decode_select(struct tcb *const tcp, const kernel_ulong_t *const args,
+             void (*const print_tv_ts) (struct tcb *, kernel_ulong_t),
+             const char * (*const sprint_tv_ts) (struct tcb *, kernel_ulong_t))
 {
        int i, j;
        int nfds, fdsize;
        fd_set *fds = NULL;
        const char *sep;
-       long arg;
+       kernel_ulong_t addr;
 
-       /* Kernel truncates arg[0] to int, we do the same. */
+       /* Kernel truncates args[0] to int, we do the same. */
        nfds = (int) args[0];
 
        /* Kernel rejects negative nfds, so we don't parse it either. */
@@ -102,13 +102,13 @@ decode_select(struct tcb *const tcp, const kernel_ureg_t *const args,
                if (verbose(tcp) && fdsize > 0)
                        fds = malloc(fdsize);
                for (i = 0; i < 3; i++) {
-                       arg = args[i+1];
+                       addr = args[i+1];
                        tprints(", ");
                        if (!fds) {
-                               printaddr(arg);
+                               printaddr(addr);
                                continue;
                        }
-                       if (umoven_or_printaddr(tcp, arg, fdsize, fds))
+                       if (umoven_or_printaddr(tcp, addr, fdsize, fds))
                                continue;
                        tprints("[");
                        for (j = 0, sep = "";; j++) {
@@ -146,8 +146,8 @@ decode_select(struct tcb *const tcp, const kernel_ureg_t *const args,
                for (i = 0; i < 3 && ready_fds > 0; i++) {
                        int first = 1;
 
-                       arg = args[i+1];
-                       if (!arg || !fds || umoven(tcp, arg, fdsize, fds) < 0)
+                       addr = args[i+1];
+                       if (!addr || !fds || umoven(tcp, addr, fdsize, fds) < 0)
                                continue;
                        for (j = 0;; j++) {
                                j = next_set_bit(fds, j, nfds);
@@ -192,7 +192,7 @@ decode_select(struct tcb *const tcp, const kernel_ureg_t *const args,
 
 SYS_FUNC(oldselect)
 {
-       kernel_ureg_t select_args[5];
+       kernel_ulong_t select_args[5];
        unsigned int oldselect_args[5];
 
        if (sizeof(*select_args) == sizeof(*oldselect_args)) {
@@ -227,7 +227,7 @@ SYS_FUNC(select)
 }
 
 static int
-umove_kulong_array_or_printaddr(struct tcb *const tcp, const kernel_ureg_t addr,
+umove_kulong_array_or_printaddr(struct tcb *const tcp, const kernel_ulong_t addr,
                                kernel_ulong_t *const ptr, const size_t n)
 {
 #ifndef current_klongsize
@@ -256,7 +256,7 @@ SYS_FUNC(pselect6)
                if (!umove_kulong_array_or_printaddr(tcp, tcp->u_arg[5],
                                                     data, ARRAY_SIZE(data))) {
                        tprints("{");
-                       /* NB: kernel requires data[1] == NSIG / 8 */
+                       /* NB: kernel requires data[1] == NSIG_BYTES */
                        print_sigset_addr_len(tcp, data[0], data[1]);
                        tprintf(", %" PRI_klu "}", data[1]);
                }