]> granicus.if.org Git - strace/blobdiff - stream.c
Fix decoding of file descriptors
[strace] / stream.c
index 8c7dfda3cf744b24469c26d7039b7e0891ba8833..eb4e3964b924bd9ae7da2658207f381d9b5588d3 100644 (file)
--- a/stream.c
+++ b/stream.c
@@ -55,9 +55,9 @@
 #ifndef HAVE_STROPTS_H
 #define RS_HIPRI 1
 struct strbuf {
-        int     maxlen;                 /* no. of bytes in buffer */
-        int     len;                    /* no. of bytes returned */
-        char    *buf;                   /* pointer to data */
+       int     maxlen;                 /* no. of bytes in buffer */
+       int     len;                    /* no. of bytes returned */
+       const char *buf;                /* pointer to data */
 };
 #define MORECTL 1
 #define MOREDATA 2
@@ -338,7 +338,9 @@ decode_poll(struct tcb *tcp, long pts)
                                tprintf("{fd=%d}", fds.fd);
                                continue;
                        }
-                       tprintf("{fd=%d, events=", fds.fd);
+                       tprintf("{fd=");
+                       printfd(tcp, fds.fd);
+                       tprintf(", events=");
                        printflags(pollflags, fds.events, "POLL???");
                        tprintf("}");
                }
@@ -350,7 +352,7 @@ decode_poll(struct tcb *tcp, long pts)
        } else {
                static char outstr[1024];
                char str[64];
-                const char *flagstr;
+               const char *flagstr;
                unsigned int cumlen;
 
                if (syserror(tcp))
@@ -468,7 +470,7 @@ int
 sys_poll(tcp)
 struct tcb *tcp;
 {
-       return 0;
+       return 0;
 }
 #endif
 
@@ -1033,10 +1035,7 @@ int len;
 #endif /* TI_BIND */
 
 
-static int
-internal_stream_ioctl(tcp, arg)
-struct tcb *tcp;
-int arg;
+static int internal_stream_ioctl(struct tcb *tcp, int arg)
 {
        struct strioctl si;
        struct ioctlent *iop;
@@ -1151,9 +1150,6 @@ int arg;
        case SI_GETUDATA:
                if (entering(tcp))
                        break;
-#if 0
-               tprintf("struct si_udata ");
-#endif
                if (umove(tcp, (int) si.ic_dp, &udata) < 0)
                        tprintf("{...}");
                else {
@@ -1164,9 +1160,6 @@ int arg;
                        tprintf("servtype=%d, so_state=%d, ",
                                udata.servtype, udata.so_state);
                        tprintf("so_options=%d", udata.so_options);
-#if 0
-                       tprintf(", tsdusize=%d", udata.tsdusize);
-#endif
                        tprintf("}");
                }
                break;