summaryrefslogtreecommitdiff
path: root/fd.c
AgeCommit message (Collapse)AuthorFilesLines
2012-10-02Convert remaining bcopy() calls to memcpy()Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2012-10-02Convert remaining sprintf calls to snprintfAlan Coopersmith1-3/+5
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2012-10-02Move debug statement before panic() call, so it can actually runAlan Coopersmith1-1/+1
Fixes compiler warning: "fd.c", line 481: warning: statement not reached Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-07-21Convert to X.Org standard indentation & cleanup whitespaceAlan Coopersmith1-355/+337
Performed with util/modular/x-indent-all.sh, followed by manual fixups Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-07-08Retry _X11TransConnect on TRANS_TRY_CONNECT_AGAINJeff Smith1-4/+7
Reading through Xtranssock.c reveals that when _X11TransConnect returns the value TRANS_TRY_CONNECT_AGAIN, it turns off the abstract socket flag, so that attempting _X11TransConnect might succeed the second time where it failed the first time. Now xscope will attempt the connection a second time when it receives the TRANS_TRY_CONNECT_AGAIN return value on the first connection attempt. Signed-off-by: Jeff Smith <whydoubt@yahoo.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-07-08Bug 46696 - Try alternate protocol on X11 connection failure.Peter Jeremy1-13/+23
In USE_XTRANS mode, MakeConnection() cycles through a selection of protocol choices until it finds one where it can open a socket to the server. It then attempts an X11 connection via that socket and aborts if one isn't possible. This patch modifies the code to try an alternate protocol if the X11 connection fails. https://bugs.freedesktop.org/show_bug.cgi?id=46696 Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-07-08Use __XFDS_BITS macros from Xpoll.h instead of direct __fds_bits accessAlan Coopersmith1-2/+7
Different platforms use different names for the fd_set members, so use the existing Xpoll.h macros for greater portability. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-07-08Bug 46689 - xscope fd_set debug output is undefinedPeter Jeremy1-4/+3
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>
2012-03-04Include <arpa/inet.h> for inet_addr in !USE_XTRANS caseJeremy Huddleston1-0/+3
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-01-15Check the right return value for malloc failureAlan Coopersmith1-1/+1
Error detected by Solaris Studio 12.3 code analyzer: WARNING 1 (MRC): missing null-pointer check after malloc: calloc(((ullong)MaxFD),48) at: InitializeFD() <app/xscope/fd.c : 107> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-09-30File descriptors should be stored in ints not shortsAlan Coopersmith1-1/+1
All OS routines take and return ints for file descriptors, so stop converting back and forth to shorts. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-09-30Remove StaticMaxFD now that all uses now allocate dynamicallyAlan Coopersmith1-5/+0
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-09-30Make FDinfo dynamically allocatedAlan Coopersmith1-0/+4
We still allocate one fdinfo struct for every possible FD up front instead of resizing as needed, but they're much smaller now that we just have a pointer to the 32k buffer instead of including it directly in the fdinfo. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-09-30Use calloc() instead of malloc(); bzero();Alan Coopersmith1-2/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-09-30Stop wrapping malloc & freeAlan Coopersmith1-3/+2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-10-30Sun's copyrights now belong to OracleAlan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-05-14Fallback on other transports.Jeremy Huddleston1-4/+9
This adds support for --disable-unix-transport Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-29Eliminate a few compiler warnings for style and signedness.Jeremy Huddleston1-2/+2
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-01-14Update Sun license notices to current X.Org standard formAlan Coopersmith1-23/+17
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-09-28Replace platform #ifdefs with autoconf testsAlan Coopersmith1-11/+7
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-05-06Clear many compiler & sparse warningsAlan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-05-06Convert select() arguments back to fd_set structuresAlan Coopersmith1-11/+22
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-05-06Ansify prototypes and move extern declarations to header filesAlan Coopersmith1-22/+18
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-05-06Merge branch 'keithp'Alan Coopersmith1-26/+249
Conflicts: common.c decode11.c fd.c fd.h print11.c prtype.c scope.c scope.h server.c table11.c x11.h xscope.man
2009-05-04Use Unix sockets for local connectionsKeith Packard1-37/+48
2009-05-04Import xscope bits into keithp.com CVSKeith Packard1-69/+207
2008-09-11Convert more function declarations to ANSI CAlan Coopersmith1-2/+2
2008-09-11Merge Sun's version of xscope inStuart Kreitman1-77/+89
Conversion to ANSI C SysVR4 support Conversion of networking code to use xtrans
2008-09-11Import initial version from James PetersonAlan Coopersmith1-0/+263