From e63977f320b8678d66bb061b9502dc0764a5427f Mon Sep 17 00:00:00 2001 From: Peter Jeremy Date: Mon, 27 Feb 2012 19:08:25 +1100 Subject: 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 --- fd.c | 7 +++---- 1 file 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) { -- cgit v1.2.1