Commit 64d51869 authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

whitespace cleanup

empty lines and trailing whitespace
parent e5b4532a
...@@ -210,7 +210,7 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port) ...@@ -210,7 +210,7 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port)
strcpy (mybuf, address); strcpy (mybuf, address);
/* Parse the string to get each component */ /* Parse the string to get each component */
/* Get the protocol part */ /* Get the protocol part */
_protocol = mybuf; _protocol = mybuf;
...@@ -287,9 +287,9 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port) ...@@ -287,9 +287,9 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port)
} }
#if defined(IPv6) && defined(AF_INET6) #if defined(IPv6) && defined(AF_INET6)
/* hostname in IPv6 [numeric_addr]:0 form? */ /* hostname in IPv6 [numeric_addr]:0 form? */
else if ( (_host_len > 3) && else if ( (_host_len > 3) &&
((strcmp(_protocol, "tcp") == 0) || (strcmp(_protocol, "inet6") == 0)) ((strcmp(_protocol, "tcp") == 0) || (strcmp(_protocol, "inet6") == 0))
&& (*_host == '[') && (*(_host + _host_len - 1) == ']') ) { && (*_host == '[') && (*(_host + _host_len - 1) == ']') ) {
struct sockaddr_in6 sin6; struct sockaddr_in6 sin6;
*(_host + _host_len - 1) = '\0'; *(_host + _host_len - 1) = '\0';
...@@ -451,7 +451,7 @@ TRANS(Open) (int type, char *address) ...@@ -451,7 +451,7 @@ TRANS(Open) (int type, char *address)
if (ciptr == NULL) if (ciptr == NULL)
{ {
if (!(thistrans->flags & TRANS_DISABLED)) if (!(thistrans->flags & TRANS_DISABLED))
{ {
PRMSG (1,"Open: transport open failed for %s/%s:%s\n", PRMSG (1,"Open: transport open failed for %s/%s:%s\n",
protocol, host, port); protocol, host, port);
...@@ -625,7 +625,7 @@ TRANS(ReopenCLTSServer) (int trans_id, int fd, char *port) ...@@ -625,7 +625,7 @@ TRANS(ReopenCLTSServer) (int trans_id, int fd, char *port)
int int
TRANS(GetReopenInfo) (XtransConnInfo ciptr, TRANS(GetReopenInfo) (XtransConnInfo ciptr,
int *trans_id, int *fd, char **port) int *trans_id, int *fd, char **port)
{ {
...@@ -731,7 +731,7 @@ TRANS(SetOption) (XtransConnInfo ciptr, int option, int arg) ...@@ -731,7 +731,7 @@ TRANS(SetOption) (XtransConnInfo ciptr, int option, int arg)
#endif /* F_SETFD */ #endif /* F_SETFD */
break; break;
} }
return ret; return ret;
} }
...@@ -750,10 +750,10 @@ TRANS(NoListen) (char * protocol) ...@@ -750,10 +750,10 @@ TRANS(NoListen) (char * protocol)
{ {
Xtransport *trans; Xtransport *trans;
int i = 0, ret = 0; int i = 0, ret = 0;
if ((trans = TRANS(SelectTransport)(protocol)) == NULL) if ((trans = TRANS(SelectTransport)(protocol)) == NULL)
{ {
PRMSG (1,"TransNoListen: unable to find transport: %s\n", PRMSG (1,"TransNoListen: unable to find transport: %s\n",
protocol, 0, 0); protocol, 0, 0);
return -1; return -1;
...@@ -834,7 +834,7 @@ TRANS(Connect) (XtransConnInfo ciptr, char *address) ...@@ -834,7 +834,7 @@ TRANS(Connect) (XtransConnInfo ciptr, char *address)
if (protocol) free (protocol); if (protocol) free (protocol);
if (host) free (host); if (host) free (host);
if (port) free (port); if (port) free (port);
return ret; return ret;
} }
...@@ -922,7 +922,7 @@ TRANS(IsLocal) (XtransConnInfo ciptr) ...@@ -922,7 +922,7 @@ TRANS(IsLocal) (XtransConnInfo ciptr)
int int
TRANS(GetMyAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp, TRANS(GetMyAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp,
Xtransaddr **addrp) Xtransaddr **addrp)
{ {
...@@ -942,7 +942,7 @@ TRANS(GetMyAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp, ...@@ -942,7 +942,7 @@ TRANS(GetMyAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp,
} }
int int
TRANS(GetPeerAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp, TRANS(GetPeerAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp,
Xtransaddr **addrp) Xtransaddr **addrp)
{ {
...@@ -1008,7 +1008,7 @@ complete_network_count (void) ...@@ -1008,7 +1008,7 @@ complete_network_count (void)
int int
TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret, TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
XtransConnInfo **ciptrs_ret) XtransConnInfo **ciptrs_ret)
{ {
...@@ -1089,7 +1089,7 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret, ...@@ -1089,7 +1089,7 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
if (Xtransports[i].transport_id == TRANS_SOCKET_INET6_INDEX) if (Xtransports[i].transport_id == TRANS_SOCKET_INET6_INDEX)
ipv6_succ = 1; ipv6_succ = 1;
#endif #endif
PRMSG (5, PRMSG (5,
"MakeAllCOTSServerListeners: opened listener for %s, %d\n", "MakeAllCOTSServerListeners: opened listener for %s, %d\n",
trans->TransName, ciptr->fd, 0); trans->TransName, ciptr->fd, 0);
...@@ -1119,12 +1119,12 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret, ...@@ -1119,12 +1119,12 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
} }
else else
*ciptrs_ret = NULL; *ciptrs_ret = NULL;
return 0; return 0;
} }
int int
TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret, TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
XtransConnInfo **ciptrs_ret) XtransConnInfo **ciptrs_ret)
{ {
...@@ -1217,7 +1217,7 @@ TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret, ...@@ -1217,7 +1217,7 @@ TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
} }
else else
*ciptrs_ret = NULL; *ciptrs_ret = NULL;
return 0; return 0;
} }
......
...@@ -467,7 +467,7 @@ TRANS(GetPeerNetworkId)( ...@@ -467,7 +467,7 @@ TRANS(GetPeerNetworkId)(
#endif /* ICE_t */ #endif /* ICE_t */
int int
TRANS(GetHostname) ( TRANS(GetHostname) (
char * /* buf */, char * /* buf */,
int /* maxlen */ int /* maxlen */
......
...@@ -53,10 +53,10 @@ from The Open Group. ...@@ -53,10 +53,10 @@ from The Open Group.
#define _XTRANSINT_H_ #define _XTRANSINT_H_
/* /*
* XTRANSDEBUG will enable the PRMSG() macros used in the X Transport * XTRANSDEBUG will enable the PRMSG() macros used in the X Transport
* Interface code. Each use of the PRMSG macro has a level associated with * Interface code. Each use of the PRMSG macro has a level associated with
* it. XTRANSDEBUG is defined to be a level. If the invocation level is =< * it. XTRANSDEBUG is defined to be a level. If the invocation level is =<
* the value of XTRANSDEBUG, then the message will be printed out to stderr. * the value of XTRANSDEBUG, then the message will be printed out to stderr.
* Recommended levels are: * Recommended levels are:
* *
* XTRANSDEBUG=1 Error messages * XTRANSDEBUG=1 Error messages
......
...@@ -51,7 +51,7 @@ from The Open Group. ...@@ -51,7 +51,7 @@ from The Open Group.
/* /*
* *
* The connection code/ideas in lib/X and server/os for SVR4/Intel * The connection code/ideas in lib/X and server/os for SVR4/Intel
* environments was contributed by the following companies/groups: * environments was contributed by the following companies/groups:
* *
* MetroLink Inc * MetroLink Inc
...@@ -63,12 +63,12 @@ from The Open Group. ...@@ -63,12 +63,12 @@ from The Open Group.
* *
* The goal is to have common connection code among all SVR4/Intel vendors. * The goal is to have common connection code among all SVR4/Intel vendors.
* *
* ALL THE ABOVE COMPANIES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS * ALL THE ABOVE COMPANIES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
* IN NO EVENT SHALL THESE COMPANIES * BE LIABLE FOR ANY SPECIAL, INDIRECT * IN NO EVENT SHALL THESE COMPANIES * BE LIABLE FOR ANY SPECIAL, INDIRECT
* OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS * OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
* OR PERFORMANCE OF THIS SOFTWARE. * OR PERFORMANCE OF THIS SOFTWARE.
*/ */
...@@ -1102,7 +1102,7 @@ TRANS(ISCOpenServer)(XtransConnInfo ciptr, char *port) ...@@ -1102,7 +1102,7 @@ TRANS(ISCOpenServer)(XtransConnInfo ciptr, char *port)
PRMSG(1,"ISCOpenServer: failed to link %s to %s\n", PRMSG(1,"ISCOpenServer: failed to link %s to %s\n",
server_path, server_unix_path, 0 ); server_path, server_unix_path, 0 );
/* /*
* Don't make this failure fatal since the listener * Don't make this failure fatal since the listener
* is already established, and this just for compatability * is already established, and this just for compatability
*/ */
#else #else
...@@ -1117,7 +1117,7 @@ TRANS(ISCOpenServer)(XtransConnInfo ciptr, char *port) ...@@ -1117,7 +1117,7 @@ TRANS(ISCOpenServer)(XtransConnInfo ciptr, char *port)
PRMSG(1,"ISCOpenServer: failed to link %s to %s\n", PRMSG(1,"ISCOpenServer: failed to link %s to %s\n",
server_path, server_unix_path, 0 ); server_path, server_unix_path, 0 );
/* /*
* Don't make this failure fatal since the listener * Don't make this failure fatal since the listener
* is already established, and this just for compatability * is already established, and this just for compatability
*/ */
#endif /* SVR4 */ #endif /* SVR4 */
...@@ -2210,7 +2210,7 @@ TRANS(LocalReopenServer)(int type, int index, int fd, char *port) ...@@ -2210,7 +2210,7 @@ TRANS(LocalReopenServer)(int type, int index, int fd, char *port)
#ifdef TRANS_CLIENT #ifdef TRANS_CLIENT
static XtransConnInfo static XtransConnInfo
TRANS(LocalOpenCOTSClient)(Xtransport *thistrans, char *protocol, TRANS(LocalOpenCOTSClient)(Xtransport *thistrans, char *protocol,
char *host, char *port) char *host, char *port)
{ {
...@@ -2225,7 +2225,7 @@ TRANS(LocalOpenCOTSClient)(Xtransport *thistrans, char *protocol, ...@@ -2225,7 +2225,7 @@ TRANS(LocalOpenCOTSClient)(Xtransport *thistrans, char *protocol,
#ifdef TRANS_SERVER #ifdef TRANS_SERVER
static XtransConnInfo static XtransConnInfo
TRANS(LocalOpenCOTSServer)(Xtransport *thistrans, char *protocol, TRANS(LocalOpenCOTSServer)(Xtransport *thistrans, char *protocol,
char *host, char *port) char *host, char *port)
{ {
...@@ -2269,7 +2269,7 @@ TRANS(LocalOpenCOTSServer)(Xtransport *thistrans, char *protocol, ...@@ -2269,7 +2269,7 @@ TRANS(LocalOpenCOTSServer)(Xtransport *thistrans, char *protocol,
#ifdef TRANS_CLIENT #ifdef TRANS_CLIENT
static XtransConnInfo static XtransConnInfo
TRANS(LocalOpenCLTSClient)(Xtransport *thistrans, char *protocol, TRANS(LocalOpenCLTSClient)(Xtransport *thistrans, char *protocol,
char *host, char *port) char *host, char *port)
{ {
...@@ -2284,7 +2284,7 @@ TRANS(LocalOpenCLTSClient)(Xtransport *thistrans, char *protocol, ...@@ -2284,7 +2284,7 @@ TRANS(LocalOpenCLTSClient)(Xtransport *thistrans, char *protocol,
#ifdef TRANS_SERVER #ifdef TRANS_SERVER
static XtransConnInfo static XtransConnInfo
TRANS(LocalOpenCLTSServer)(Xtransport *thistrans, char *protocol, TRANS(LocalOpenCLTSServer)(Xtransport *thistrans, char *protocol,
char *host, char *port) char *host, char *port)
{ {
...@@ -2524,7 +2524,7 @@ TRANS(LocalCloseForCloning)(XtransConnInfo ciptr) ...@@ -2524,7 +2524,7 @@ TRANS(LocalCloseForCloning)(XtransConnInfo ciptr)
* MakeAllCOTSServerListeners() will go through the entire Xtransports[] * MakeAllCOTSServerListeners() will go through the entire Xtransports[]
* array defined in Xtrans.c and try to OpenCOTSServer() for each entry. * array defined in Xtrans.c and try to OpenCOTSServer() for each entry.
* We will add duplicate entries to that table so that the OpenCOTSServer() * We will add duplicate entries to that table so that the OpenCOTSServer()
* function will get called once for each type of local transport. * function will get called once for each type of local transport.
* *
* The TransName is in lowercase, so it will never match during a normal * The TransName is in lowercase, so it will never match during a normal
* call to SelectTransport() in Xtrans.c. * call to SelectTransport() in Xtrans.c.
......
...@@ -140,7 +140,7 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp) ...@@ -140,7 +140,7 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp)
{ {
*familyp=FamilyLocal; *familyp=FamilyLocal;
} }
else else
{ {
*familyp=FamilyInternet; *familyp=FamilyInternet;
*addrlenp = sizeof (struct in_addr); *addrlenp = sizeof (struct in_addr);
...@@ -165,7 +165,7 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp) ...@@ -165,7 +165,7 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp)
*familyp=FamilyLocal; *familyp=FamilyLocal;
break; break;
} }
#endif /* defined(UNIXCONN) || defined(LOCALCONN)*/ #endif /* defined(UNIXCONN) || defined(LOCALCONN) */
#if (defined(__SCO__) || defined(__UNIXWARE__)) && defined(LOCALCONN) #if (defined(__SCO__) || defined(__UNIXWARE__)) && defined(LOCALCONN)
case 0: case 0:
...@@ -188,7 +188,7 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp) ...@@ -188,7 +188,7 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp)
* In the case of a local connection, we need to get the * In the case of a local connection, we need to get the
* host name for authentication. * host name for authentication.
*/ */
char hostnamebuf[256]; char hostnamebuf[256];
int len = TRANS(GetHostname) (hostnamebuf, sizeof hostnamebuf); int len = TRANS(GetHostname) (hostnamebuf, sizeof hostnamebuf);
...@@ -377,7 +377,7 @@ TRANS(GetPeerNetworkId) (XtransConnInfo ciptr) ...@@ -377,7 +377,7 @@ TRANS(GetPeerNetworkId) (XtransConnInfo ciptr)
* Assume that if it does not respond in NAMESERVER_TIMEOUT seconds * Assume that if it does not respond in NAMESERVER_TIMEOUT seconds
* that something is wrong and do not make the user wait. * that something is wrong and do not make the user wait.
* gethostbyaddr will continue after a signal, so we have to * gethostbyaddr will continue after a signal, so we have to
* jump out of it. * jump out of it.
*/ */
nameserver_timedout = 0; nameserver_timedout = 0;
...@@ -469,7 +469,7 @@ is_numeric (char *str) ...@@ -469,7 +469,7 @@ is_numeric (char *str)
* it's not save if the directory has non-root ownership or the sticky * it's not save if the directory has non-root ownership or the sticky
* bit cannot be set and fail. * bit cannot be set and fail.
*/ */
static int static int
trans_mkdir(char *path, int mode) trans_mkdir(char *path, int mode)
{ {
struct stat buf; struct stat buf;
...@@ -492,7 +492,7 @@ trans_mkdir(char *path, int mode) ...@@ -492,7 +492,7 @@ trans_mkdir(char *path, int mode)
if (mode & 01000) { if (mode & 01000) {
PRMSG(1, "mkdir: ERROR: euid != 0," PRMSG(1, "mkdir: ERROR: euid != 0,"
"directory %s will not be created.\n", "directory %s will not be created.\n",
path, 0, 0); path, 0, 0);
#ifdef FAIL_HARD #ifdef FAIL_HARD
return -1; return -1;
#endif #endif
...@@ -522,7 +522,7 @@ trans_mkdir(char *path, int mode) ...@@ -522,7 +522,7 @@ trans_mkdir(char *path, int mode)
} }
return 0; return 0;
} else { } else {
if (S_ISDIR(buf.st_mode)) { if (S_ISDIR(buf.st_mode)) {
int updateOwner = 0; int updateOwner = 0;
...@@ -541,7 +541,7 @@ trans_mkdir(char *path, int mode) ...@@ -541,7 +541,7 @@ trans_mkdir(char *path, int mode)
*/ */
if ((~mode) & 0077 & buf.st_mode) if ((~mode) & 0077 & buf.st_mode)
updateMode = 1; updateMode = 1;
/* /*
* If the directory is not writeable not everybody may * If the directory is not writeable not everybody may
* be able to create sockets. Therefore warn if mode * be able to create sockets. Therefore warn if mode
...@@ -551,7 +551,7 @@ trans_mkdir(char *path, int mode) ...@@ -551,7 +551,7 @@ trans_mkdir(char *path, int mode)
updateMode = 1; updateMode = 1;
status |= WARN_NO_ACCESS; status |= WARN_NO_ACCESS;
} }
/* /*
* If 'sticky' bit is requested fail if owner isn't root * If 'sticky' bit is requested fail if owner isn't root
* as we assume the caller makes certain security implications * as we assume the caller makes certain security implications
...@@ -563,7 +563,7 @@ trans_mkdir(char *path, int mode) ...@@ -563,7 +563,7 @@ trans_mkdir(char *path, int mode)
updateMode = 1; updateMode = 1;
} }
} }
#ifdef HAS_FCHOWN #ifdef HAS_FCHOWN
/* /*
* If fchown(2) and fchmod(2) are available, try to correct the * If fchown(2) and fchmod(2) are available, try to correct the
...@@ -598,7 +598,7 @@ trans_mkdir(char *path, int mode) ...@@ -598,7 +598,7 @@ trans_mkdir(char *path, int mode)
} }
} }
#endif #endif
if (updateOwner && !updatedOwner) { if (updateOwner && !updatedOwner) {
#ifdef FAIL_HARD #ifdef FAIL_HARD
if (status & FAIL_IF_NOT_ROOT) { if (status & FAIL_IF_NOT_ROOT) {
...@@ -610,7 +610,7 @@ trans_mkdir(char *path, int mode) ...@@ -610,7 +610,7 @@ trans_mkdir(char *path, int mode)
PRMSG(1, "mkdir: Owner of %s should be set to root\n", PRMSG(1, "mkdir: Owner of %s should be set to root\n",
path, 0, 0); path, 0, 0);
} }
if (updateMode && !updatedMode) { if (updateMode && !updatedMode) {
#ifdef FAIL_HARD #ifdef FAIL_HARD
if (status & FAIL_IF_NOMODE) { if (status & FAIL_IF_NOMODE) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment