diff options
author | Jeff Smith <whydoubt@yahoo.com> | 2010-07-28 15:29:56 -0500 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-07-08 11:33:55 -0700 |
commit | 670016475f1d7833bca5206a4d46704db36bccdb (patch) | |
tree | 4ebea700abbd290ac1de571205de92f592dbee59 | |
parent | ea0a2788b1e82f2b19a3c46e6d42d0a86fd17f38 (diff) |
Retry _X11TransConnect on TRANS_TRY_CONNECT_AGAIN
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>
-rw-r--r-- | fd.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -284,10 +284,13 @@ MakeConnection( } debug(4,(stderr, "Opened ")); if ((connect_stat = _X11TransConnect(*trans_conn,address)) < 0 ) { - _X11TransClose(*trans_conn); - *trans_conn = NULL; - debug(1,(stderr, "TransConnect %s failed\n", address)); - continue; + if ((connect_stat != TRANS_TRY_CONNECT_AGAIN) || + (_X11TransConnect(*trans_conn,address) < 0 )) { + _X11TransClose(*trans_conn); + *trans_conn = NULL; + debug(1,(stderr, "TransConnect %s failed\n", address)); + continue; + } } debug(4,(stderr, "Connected\n")); break; |