summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Jeremy <peterjeremy@acm.org>2012-02-27 19:08:25 +1100
committerAlan Coopersmith <alan.coopersmith@oracle.com>2012-07-08 10:51:28 -0700
commite63977f320b8678d66bb061b9502dc0764a5427f (patch)
tree60b68072d901f5f491378523425ce8f578d15b59
parent3bc1cf3e11be566e3d342834abe8fde7f5983a80 (diff)
Bug 46689 - xscope fd_set debug output is undefined
https://bugs.freedesktop.org/show_bug.cgi?id=46689 Change fd_set debug output to display actual contents of first 32 or 64 bits. In xscope-1.3.1, MainLoop() contains debug(128,...) code that appears intended to display the fd_set contents before and after the main select() call. In most implementations, fd_set will be a struct though it is printed as an int, thus the actual debug output is unlikely to usefully reflect the actual fd_set contents. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--fd.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fd.c b/fd.c
index 62fae22..97ae6f0 100644
--- a/fd.c
+++ b/fd.c
@@ -423,8 +423,8 @@ MainLoop(void)
/* wfds = ReadDescriptors & WriteDescriptors; */
XFD_ANDSET(&wfds, &ReadDescriptors, &WriteDescriptors);
+ debug(128,(stderr, "select %d, rfds = %#lx, wfds = %#lx, RD=%#lx, BRD=%#lx, WD=%#lx\n", HighestFD + 1, rfds.__fds_bits[0], wfds.__fds_bits[0], ReadDescriptors.__fds_bits[0], BlockedReadDescriptors.__fds_bits[0], WriteDescriptors.__fds_bits[0]));
- debug(128,(stderr, "select %d, rfds = 0%o\n", HighestFD + 1, rfds));
if (Interrupt || (!XFD_ANYSET(&rfds) && !XFD_ANYSET(&wfds)))
{
ReadCommands ();
@@ -432,9 +432,8 @@ MainLoop(void)
continue;
}
nfds = select(HighestFD + 1, &rfds, &wfds, &xfds, (struct timeval *)NULL);
- debug(128,(stderr,
- "select nfds = 0%o, rfds = 0%o, wfds = 0%o, xfds = 0%o\n",
- nfds, rfds, wfds, xfds));
+ debug(128,(stderr, "select nfds = %d, rfds = %#lx, wfds = %#lx, xfds = %#lx\n",
+ nfds, rfds.__fds_bits[0], wfds.__fds_bits[0], xfds.__fds_bits[0]));
if (nfds < 0)
{