summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-09-16 22:54:41 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-09-16 22:54:41 -0700
commiteb9ec458b7fb5332f7ae7b8faf59443a9075ec60 (patch)
treeb40d91f6edf2af21a53ed7f3b64a16a15bf8384e
parent36174eb06e805fa51c9c2e9e914fdfad4a99f50f (diff)
Strip trailing whitespace
Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}' git diff -w & git diff -b show no diffs from this change Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--Xtrans.c48
-rw-r--r--Xtrans.h6
-rw-r--r--Xtransint.h12
-rw-r--r--Xtranslcl.c52
-rw-r--r--Xtranssock.c118
-rw-r--r--Xtranstli.c316
-rw-r--r--Xtransutil.c30
-rw-r--r--configure.ac2
-rw-r--r--xtrans.m416
9 files changed, 300 insertions, 300 deletions
diff --git a/Xtrans.c b/Xtrans.c
index d90a8cc..58a7875 100644
--- a/Xtrans.c
+++ b/Xtrans.c
@@ -215,7 +215,7 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port)
strcpy (mybuf, address);
/* Parse the string to get each component */
-
+
/* Get the protocol part */
_protocol = mybuf;
@@ -292,9 +292,9 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port)
}
#if defined(IPv6) && defined(AF_INET6)
/* 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))
- && (*_host == '[') && (*(_host + _host_len - 1) == ']') ) {
+ && (*_host == '[') && (*(_host + _host_len - 1) == ']') ) {
struct sockaddr_in6 sin6;
*(_host + _host_len - 1) = '\0';
@@ -406,7 +406,7 @@ TRANS(Open) (int type, char *address)
PRMSG (2,"Open(%d,%s)\n", type, address, 0);
-#if defined(WIN32) && defined(TCPCONN)
+#if defined(WIN32) && defined(TCPCONN)
if (TRANS(WSAStartup)())
{
PRMSG (1,"Open: WSAStartup failed\n", 0, 0, 0);
@@ -465,7 +465,7 @@ TRANS(Open) (int type, char *address)
if (ciptr == NULL)
{
- if (!(thistrans->flags & TRANS_DISABLED))
+ if (!(thistrans->flags & TRANS_DISABLED))
{
PRMSG (1,"Open: transport open failed for %s/%s:%s\n",
protocol, host, port);
@@ -639,7 +639,7 @@ TRANS(ReopenCLTSServer) (int trans_id, int fd, char *port)
int
-TRANS(GetReopenInfo) (XtransConnInfo ciptr,
+TRANS(GetReopenInfo) (XtransConnInfo ciptr,
int *trans_id, int *fd, char **port)
{
@@ -695,7 +695,7 @@ TRANS(SetOption) (XtransConnInfo ciptr, int option, int arg)
break;
case 1: /* Set to non-blocking mode */
-#if defined(O_NONBLOCK) && !defined(SCO325)
+#if defined(O_NONBLOCK) && !defined(SCO325)
ret = fcntl (fd, F_GETFL, 0);
if (ret != -1)
ret = fcntl (fd, F_SETFL, ret | O_NONBLOCK);
@@ -707,7 +707,7 @@ TRANS(SetOption) (XtransConnInfo ciptr, int option, int arg)
ret = ioctl (fd, FIOSNBIO, &arg);
}
#else
-#if defined(WIN32)
+#if defined(WIN32)
{
#ifdef WIN32
u_long arg;
@@ -745,7 +745,7 @@ TRANS(SetOption) (XtransConnInfo ciptr, int option, int arg)
#endif /* F_SETFD */
break;
}
-
+
return ret;
}
@@ -760,14 +760,14 @@ TRANS(CreateListener) (XtransConnInfo ciptr, char *port, unsigned int flags)
int
TRANS(NoListen) (char * protocol)
-
+
{
Xtransport *trans;
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);
return -1;
@@ -852,7 +852,7 @@ TRANS(Connect) (XtransConnInfo ciptr, char *address)
if (protocol) xfree (protocol);
if (host) xfree (host);
if (port) xfree (port);
-
+
return ret;
}
@@ -940,7 +940,7 @@ TRANS(IsLocal) (XtransConnInfo ciptr)
int
-TRANS(GetMyAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp,
+TRANS(GetMyAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp,
Xtransaddr **addrp)
{
@@ -960,7 +960,7 @@ TRANS(GetMyAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp,
}
int
-TRANS(GetPeerAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp,
+TRANS(GetPeerAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp,
Xtransaddr **addrp)
{
@@ -1029,7 +1029,7 @@ extern int xquartz_launchd_fd;
#endif
int
-TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
+TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
XtransConnInfo **ciptrs_ret)
{
@@ -1051,7 +1051,7 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
if((ciptr = TRANS(ReopenCOTSServer(TRANS_SOCKET_LOCAL_INDEX,
xquartz_launchd_fd, getenv("DISPLAY"))))==NULL)
fprintf(stderr,"Got NULL while trying to Reopen launchd port\n");
- else
+ else
temp_ciptrs[(*count_ret)++] = ciptr;
}
#endif
@@ -1122,7 +1122,7 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
if (Xtransports[i].transport_id == TRANS_SOCKET_INET6_INDEX)
ipv6_succ = 1;
#endif
-
+
PRMSG (5,
"MakeAllCOTSServerListeners: opened listener for %s, %d\n",
trans->TransName, ciptr->fd, 0);
@@ -1152,12 +1152,12 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
}
else
*ciptrs_ret = NULL;
-
+
return 0;
}
int
-TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
+TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
XtransConnInfo **ciptrs_ret)
{
@@ -1251,7 +1251,7 @@ TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
}
else
*ciptrs_ret = NULL;
-
+
return 0;
}
@@ -1265,7 +1265,7 @@ TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
*/
-#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32)
+#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32)
/*
* emulate readv
@@ -1297,7 +1297,7 @@ static int TRANS(ReadV) (XtransConnInfo ciptr, struct iovec *iov, int iovcnt)
#endif /* SYSV && __i386__ || WIN32 || __sxg__ */
-#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32)
+#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32)
/*
* emulate writev
diff --git a/Xtrans.h b/Xtrans.h
index 5eac908..6f8f909 100644
--- a/Xtrans.h
+++ b/Xtrans.h
@@ -162,7 +162,7 @@ typedef long BytesReadable_t;
#endif
-#if defined(WIN32) || defined(USG)
+#if defined(WIN32) || defined(USG)
/*
* TRANS(Readv) and TRANS(Writev) use struct iovec, normally found
@@ -437,13 +437,13 @@ TRANS(GetPeerNetworkId)(
#endif /* ICE_t */
-int
+int
TRANS(GetHostname) (
char * /* buf */,
int /* maxlen */
);
-#if defined(WIN32) && defined(TCPCONN)
+#if defined(WIN32) && defined(TCPCONN)
int TRANS(WSAStartup)();
#endif
diff --git a/Xtransint.h b/Xtransint.h
index ff3fd0b..787d721 100644
--- a/Xtransint.h
+++ b/Xtransint.h
@@ -51,10 +51,10 @@ from The Open Group.
#define _XTRANSINT_H_
/*
- * XTRANSDEBUG will enable the PRMSG() macros used in the X Transport
- * 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 =<
- * the value of XTRANSDEBUG, then the message will be printed out to stderr.
+ * XTRANSDEBUG will enable the PRMSG() macros used in the X Transport
+ * 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 =<
+ * the value of XTRANSDEBUG, then the message will be printed out to stderr.
* Recommended levels are:
*
* XTRANSDEBUG=1 Error messages
@@ -318,7 +318,7 @@ typedef struct _Xtransport_table {
* systems, so they may be emulated.
*/
-#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32)
+#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32)
#define READV(ciptr, iov, iovcnt) TRANS(ReadV)(ciptr, iov, iovcnt)
@@ -335,7 +335,7 @@ static int TRANS(ReadV)(
#endif /* CRAY || (SYSV && __i386__) || WIN32 || __sxg__ || */
-#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32)
+#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32)
#define WRITEV(ciptr, iov, iovcnt) TRANS(WriteV)(ciptr, iov, iovcnt)
diff --git a/Xtranslcl.c b/Xtranslcl.c
index ca04e7f..ff0a62a 100644
--- a/Xtranslcl.c
+++ b/Xtranslcl.c
@@ -49,7 +49,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:
*
* MetroLink Inc
@@ -61,12 +61,12 @@ from The Open Group.
*
* The goal is to have common connection code among all SVR4/Intel vendors.
*
- * ALL THE ABOVE COMPANIES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
- * IN NO EVENT SHALL THESE COMPANIES * BE LIABLE FOR ANY SPECIAL, INDIRECT
- * OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
- * 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
+ * ALL THE ABOVE COMPANIES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
+ * IN NO EVENT SHALL THESE COMPANIES * BE LIABLE FOR ANY SPECIAL, INDIRECT
+ * OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * 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 PERFORMANCE OF THIS SOFTWARE.
*/
@@ -166,7 +166,7 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path)
return 0;
}
strcpy (sunaddr->sun_path, sun_path);
-#if defined(BSD44SOCKETS)
+#if defined(BSD44SOCKETS)
sunaddr->sun_len = strlen (sunaddr->sun_path);
#endif
@@ -194,7 +194,7 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path)
return 0;
}
strcpy (p_sunaddr->sun_path, peer_sun_path);
-#if defined(BSD44SOCKETS)
+#if defined(BSD44SOCKETS)
p_sunaddr->sun_len = strlen (p_sunaddr->sun_path);
#endif
@@ -208,7 +208,7 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path)
#ifdef LOCAL_TRANS_PTS
/* PTS */
-#if defined(SYSV) && !defined(__SCO__)
+#if defined(SYSV) && !defined(__SCO__)
#define SIGNAL_T int
#else
#define SIGNAL_T void
@@ -634,7 +634,7 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
sunaddr->sun_family=AF_UNIX;
strcpy(sunaddr->sun_path,buf);
-#if defined(BSD44SOCKETS)
+#if defined(BSD44SOCKETS)
sunaddr->sun_len=strlen(sunaddr->sun_path);
#endif
@@ -663,7 +663,7 @@ TRANS(NAMEDOpenClient)(XtransConnInfo ciptr, char *port)
int fd;
char server_path[64];
struct stat filestat;
-# ifndef sun
+# ifndef sun
extern int isastream(int);
# endif
#endif
@@ -698,7 +698,7 @@ TRANS(NAMEDOpenClient)(XtransConnInfo ciptr, char *port)
if ((filestat.st_mode & S_IFMT) != S_IFIFO) {
PRMSG(1,"NAMEDOpenClient: Device %s is not a FIFO\n", server_path, 0,0 );
/* Is this really a failure? */
- (void) close(fd);
+ (void) close(fd);
return -1;
}
@@ -741,10 +741,10 @@ TRANS(NAMEDOpenPipe)(const char *server_path)
int fd, pipefd[2];
struct stat sbuf;
int mode;
-
+
#if defined(sun) && defined(X11_t)
mode = 0775; /* Solaris requires uid or gid 0 to create X11 pipes */
-#else
+#else
#ifdef HAS_STICKY_DIR_BIT
mode = 01777;
#else
@@ -827,7 +827,7 @@ TRANS(NAMEDOpenServer)(XtransConnInfo ciptr, char *port)
if (fd < 0) {
return -1;
}
-
+
/*
* Everything looks good: fill in the XtransConnInfo structure.
*/
@@ -851,9 +851,9 @@ TRANS(NAMEDResetListener) (XtransConnInfo ciptr)
int status = TRANS_RESET_NOOP;
struct sockaddr_un *sockname=(struct sockaddr_un *) ciptr->addr;
struct stat statb;
-
+
PRMSG(2,"NAMEDResetListener(%p, %d)\n", ciptr, ciptr->fd, 0 );
-
+
if (ciptr->fd != -1) {
/*
* see if the pipe has disappeared
@@ -1998,7 +1998,7 @@ TRANS(LocalReopenServer)(int type, int index, int fd, char *port)
#ifdef TRANS_CLIENT
static XtransConnInfo
-TRANS(LocalOpenCOTSClient)(Xtransport *thistrans, char *protocol,
+TRANS(LocalOpenCOTSClient)(Xtransport *thistrans, char *protocol,
char *host, char *port)
{
@@ -2013,7 +2013,7 @@ TRANS(LocalOpenCOTSClient)(Xtransport *thistrans, char *protocol,
#ifdef TRANS_SERVER
static XtransConnInfo
-TRANS(LocalOpenCOTSServer)(Xtransport *thistrans, char *protocol,
+TRANS(LocalOpenCOTSServer)(Xtransport *thistrans, char *protocol,
char *host, char *port)
{
@@ -2057,7 +2057,7 @@ TRANS(LocalOpenCOTSServer)(Xtransport *thistrans, char *protocol,
#ifdef TRANS_CLIENT
static XtransConnInfo
-TRANS(LocalOpenCLTSClient)(Xtransport *thistrans, char *protocol,
+TRANS(LocalOpenCLTSClient)(Xtransport *thistrans, char *protocol,
char *host, char *port)
{
@@ -2072,7 +2072,7 @@ TRANS(LocalOpenCLTSClient)(Xtransport *thistrans, char *protocol,
#ifdef TRANS_SERVER
static XtransConnInfo
-TRANS(LocalOpenCLTSServer)(Xtransport *thistrans, char *protocol,
+TRANS(LocalOpenCLTSServer)(Xtransport *thistrans, char *protocol,
char *host, char *port)
{
@@ -2164,7 +2164,7 @@ TRANS(LocalResetListener)(XtransConnInfo ciptr)
{
LOCALtrans2dev *transptr;
-
+
PRMSG(2,"LocalResetListener(%x)\n",ciptr,0,0);
transptr=(LOCALtrans2dev *)ciptr->priv;
@@ -2328,7 +2328,7 @@ TRANS(LocalCloseForCloning)(XtransConnInfo ciptr)
* MakeAllCOTSServerListeners() will go through the entire Xtransports[]
* array defined in Xtrans.c and try to OpenCOTSServer() for each entry.
* 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
* call to SelectTransport() in Xtrans.c.
@@ -2342,8 +2342,8 @@ static char * local_aliases[] = {
"named",
# ifdef sun
"pipe", /* compatibility with Solaris Xlib */
-# endif
-# ifdef LOCAL_TRANS_SCO
+# endif
+# ifdef LOCAL_TRANS_SCO
"sco",
# endif
NULL };
diff --git a/Xtranssock.c b/Xtranssock.c
index 5f65738..c2f3fac 100644
--- a/Xtranssock.c
+++ b/Xtranssock.c
@@ -97,7 +97,7 @@ from the copyright holders.
#ifndef NO_TCP_H
-#if defined(linux) || defined(__GLIBC__)
+#if defined(linux) || defined(__GLIBC__)
#include <sys/param.h>
#endif /* osf */
#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
@@ -114,11 +114,11 @@ from the copyright holders.
#if (defined(__i386__) && defined(SYSV)) && !defined(SCO325) && !defined(sun)
#include <net/errno.h>
-#endif
+#endif
-#if defined(__i386__) && defined(SYSV)
+#if defined(__i386__) && defined(SYSV)
#include <sys/stropts.h>
-#endif
+#endif
#include <unistd.h>
@@ -171,7 +171,7 @@ from the copyright holders.
*
*/
-typedef struct _Sockettrans2dev {
+typedef struct _Sockettrans2dev {
char *transname;
int family;
int devcotsname;
@@ -244,7 +244,7 @@ static int TRANS(SocketINETClose) (XtransConnInfo ciptr);
#if defined HAVE_SOCKLEN_T || (defined(IPv6) && defined(AF_INET6))
# define SOCKLEN_T socklen_t
#elif defined(SVR4) || defined(__SVR4) || defined(__SCO__)
-# define SOCKLEN_T size_t
+# define SOCKLEN_T size_t
#else
# define SOCKLEN_T int
#endif
@@ -299,7 +299,7 @@ TRANS(SocketINETGetAddr) (XtransConnInfo ciptr)
#endif
bzero(socknamePtr, namelen);
-
+
if (getsockname (ciptr->fd,(struct sockaddr *) socknamePtr,
(void *)&namelen) < 0)
{
@@ -365,7 +365,7 @@ TRANS(SocketINETGetPeerAddr) (XtransConnInfo ciptr)
}
bzero(socknamePtr, namelen);
-
+
PRMSG (3,"SocketINETGetPeerAddr(%p)\n", ciptr, 0, 0);
if (getpeername (ciptr->fd, (struct sockaddr *) socknamePtr,
@@ -574,7 +574,7 @@ TRANS(SocketOpenCOTSClientBase) (char *transname, char *protocol,
}
static XtransConnInfo
-TRANS(SocketOpenCOTSClient) (Xtransport *thistrans, char *protocol,
+TRANS(SocketOpenCOTSClient) (Xtransport *thistrans, char *protocol,
char *host, char *port)
{
return TRANS(SocketOpenCOTSClientBase)(
@@ -588,7 +588,7 @@ TRANS(SocketOpenCOTSClient) (Xtransport *thistrans, char *protocol,
#ifdef TRANS_SERVER
static XtransConnInfo
-TRANS(SocketOpenCOTSServer) (Xtransport *thistrans, char *protocol,
+TRANS(SocketOpenCOTSServer) (Xtransport *thistrans, char *protocol,
char *host, char *port)
{
@@ -655,7 +655,7 @@ TRANS(SocketOpenCOTSServer) (Xtransport *thistrans, char *protocol,
#ifdef TRANS_CLIENT
static XtransConnInfo
-TRANS(SocketOpenCLTSClient) (Xtransport *thistrans, char *protocol,
+TRANS(SocketOpenCLTSClient) (Xtransport *thistrans, char *protocol,
char *host, char *port)
{
@@ -694,7 +694,7 @@ TRANS(SocketOpenCLTSClient) (Xtransport *thistrans, char *protocol,
#ifdef TRANS_SERVER
static XtransConnInfo
-TRANS(SocketOpenCLTSServer) (Xtransport *thistrans, char *protocol,
+TRANS(SocketOpenCLTSServer) (Xtransport *thistrans, char *protocol,
char *host, char *port)
{
@@ -850,7 +850,7 @@ set_sun_path(const char *port, const char *upath, char *path, int abstract)
#ifdef TRANS_SERVER
static int
-TRANS(SocketCreateListener) (XtransConnInfo ciptr,
+TRANS(SocketCreateListener) (XtransConnInfo ciptr,
struct sockaddr *sockname,
int socknamelen, unsigned int flags)
@@ -878,7 +878,7 @@ TRANS(SocketCreateListener) (XtransConnInfo ciptr,
else
return TRANS_ADDR_IN_USE;
}
-
+
if (retry-- == 0) {
PRMSG (1, "SocketCreateListener: failed to bind listener\n",
0, 0, 0);
@@ -916,7 +916,7 @@ TRANS(SocketCreateListener) (XtransConnInfo ciptr,
close (fd);
return TRANS_CREATE_LISTENER_FAILED;
}
-
+
/* Set a flag to indicate that this connection is a listener */
ciptr->flags = 1 | (ciptr->flags & TRANS_KEEPFLAGS);
@@ -946,7 +946,7 @@ TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, char *port, unsigned int
#ifdef X11_t
char portbuf[PORTBUFSIZE];
#endif
-
+
PRMSG (2, "SocketINETCreateListener(%s)\n", port, 0, 0);
#ifdef X11_t
@@ -987,11 +987,11 @@ TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, char *port, unsigned int
else
{
tmpport = strtol (port, (char**)NULL, 10);
- /*
+ /*
* check that somehow the port address isn't negative or in
* the range of reserved port addresses. This can happen and
- * be very bad if the server is suid-root and the user does
- * something (dumb) like `X :60049`.
+ * be very bad if the server is suid-root and the user does
+ * something (dumb) like `X :60049`.
*/
if (tmpport < 1024 || tmpport > USHRT_MAX)
return TRANS_CREATE_LISTENER_FAILED;
@@ -1105,7 +1105,7 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port,
return TRANS_CREATE_LISTENER_FAILED;
}
-#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__))
+#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__))
sockname.sun_len = strlen(sockname.sun_path);
#endif
@@ -1289,7 +1289,7 @@ TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status)
#endif
/*
- * Get this address again because the transport may give a more
+ * Get this address again because the transport may give a more
* specific address now that a connection is established.
*/
@@ -1388,7 +1388,7 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status)
*status = TRANS_ACCEPT_BAD_MALLOC;
return NULL;
}
-
+
newciptr->peeraddrlen = ciptr->addrlen;
memcpy (newciptr->peeraddr, ciptr->addr, newciptr->addrlen);
@@ -1411,7 +1411,7 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status)
#if defined(IPv6) && defined(AF_INET6)
struct addrlist {
struct addrinfo * addr;
- struct addrinfo * firstaddr;
+ struct addrinfo * firstaddr;
char port[PORTBUFSIZE];
char host[MAXHOSTNAMELEN];
};
@@ -1513,7 +1513,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
while (socketaddr == NULL) {
if (addrlist->addr == NULL) {
- if (resetonce) {
+ if (resetonce) {
/* Already checked entire list - no usable addresses */
PRMSG (1, "SocketINETConnect() no usable address "
"for %s:%s\n", host, port, 0);
@@ -1523,7 +1523,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
resetonce = 1;
addrlist->addr = addrlist->firstaddr;
}
- }
+ }
socketaddr = addrlist->addr->ai_addr;
socketaddrlen = addrlist->addr->ai_addrlen;
@@ -1533,10 +1533,10 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
PRMSG (4,"SocketINETConnect() sockname.sin_addr = %s\n",
inet_ntop(addrlist->addr->ai_family,&sin->sin_addr,
- ntopbuf,sizeof(ntopbuf)), 0, 0);
+ ntopbuf,sizeof(ntopbuf)), 0, 0);
PRMSG (4,"SocketINETConnect() sockname.sin_port = %d\n",
- ntohs(sin->sin_port), 0, 0);
+ ntohs(sin->sin_port), 0, 0);
if (Sockettrans2devtab[ciptr->index].family == AF_INET6) {
if (strcmp(Sockettrans2devtab[ciptr->index].transname,
@@ -1571,13 +1571,13 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
}
} else if (addrlist->addr->ai_family == AF_INET6) {
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) socketaddr;
-
+
PRMSG (4,"SocketINETConnect() sockname.sin6_addr = %s\n",
inet_ntop(addrlist->addr->ai_family,
&sin6->sin6_addr,ntopbuf,sizeof(ntopbuf)),
- 0, 0);
+ 0, 0);
PRMSG (4,"SocketINETConnect() sockname.sin6_port = %d\n",
- ntohs(sin6->sin6_port), 0, 0);
+ ntohs(sin6->sin6_port), 0, 0);
if (Sockettrans2devtab[ciptr->index].family == AF_INET) {
if (strcmp(Sockettrans2devtab[ciptr->index].transname,
@@ -1615,7 +1615,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
if (socketaddr == NULL) {
addrlist->addr = addrlist->addr->ai_next;
}
- }
+ }
}
#else
{
@@ -1658,7 +1658,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
ESET(EPROTOTYPE);
return TRANS_CONNECT_FAILED;
}
-
+
memcpy ((char *) &sockname.sin_addr, (char *) hostp->h_addr,
sizeof (sockname.sin_addr));
@@ -1737,7 +1737,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
* number of errors that made us quit before, since those
* could be caused by trying to use an IPv6 address to contact
* a machine with an IPv4-only server or other reasons that
- * only affect one of a set of addresses.
+ * only affect one of a set of addresses.
*/
if (olderrno == ECONNREFUSED || olderrno == EINTR
@@ -1760,16 +1760,16 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
PRMSG (2,"SocketINETConnect: Can't connect: errno = %d\n",
olderrno,0, 0);
- res = TRANS_CONNECT_FAILED;
+ res = TRANS_CONNECT_FAILED;
}
} else {
res = 0;
-
+
/*
* Sync up the address fields of ciptr.
*/
-
+
if (TRANS(SocketINETGetAddr) (ciptr) < 0)
{
PRMSG (1,
@@ -1835,7 +1835,7 @@ UnixHostReallyLocal (char *host)
for (j = otherhostaddr; j != NULL && equiv == 0; j = j->ai_next) {
if (i->ai_family == j->ai_family) {
if (i->ai_family == AF_INET) {
- struct sockaddr_in *sinA
+ struct sockaddr_in *sinA
= (struct sockaddr_in *) i->ai_addr;
struct sockaddr_in *sinB
= (struct sockaddr_in *) j->ai_addr;
@@ -1846,9 +1846,9 @@ UnixHostReallyLocal (char *host)
equiv = 1;
}
} else if (i->ai_family == AF_INET6) {
- struct sockaddr_in6 *sinA
+ struct sockaddr_in6 *sinA
= (struct sockaddr_in6 *) i->ai_addr;
- struct sockaddr_in6 *sinB
+ struct sockaddr_in6 *sinB
= (struct sockaddr_in6 *) j->ai_addr;
struct in6_addr *A = &sinA->sin6_addr;
struct in6_addr *B = &sinB->sin6_addr;
@@ -1860,7 +1860,7 @@ UnixHostReallyLocal (char *host)
}
}
}
-
+
freeaddrinfo(localhostaddr);
freeaddrinfo(otherhostaddr);
return equiv;
@@ -1890,13 +1890,13 @@ UnixHostReallyLocal (char *host)
* from the 1st call, so we must save the address list.
*/
- specified_local_addr_list[scount][0] =
+ specified_local_addr_list[scount][0] =
hostp->h_addr_list[scount][0];
- specified_local_addr_list[scount][1] =
+ specified_local_addr_list[scount][1] =
hostp->h_addr_list[scount][1];
- specified_local_addr_list[scount][2] =
+ specified_local_addr_list[scount][2] =
hostp->h_addr_list[scount][2];
- specified_local_addr_list[scount][3] =
+ specified_local_addr_list[scount][3] =
hostp->h_addr_list[scount][3];
scount++;
}
@@ -1912,17 +1912,17 @@ UnixHostReallyLocal (char *host)
while (hostp->h_addr_list[j])
{
- if ((specified_local_addr_list[i][0] ==
+ if ((specified_local_addr_list[i][0] ==
hostp->h_addr_list[j][0]) &&
- (specified_local_addr_list[i][1] ==
+ (specified_local_addr_list[i][1] ==
hostp->h_addr_list[j][1]) &&
- (specified_local_addr_list[i][2] ==
+ (specified_local_addr_list[i][2] ==
hostp->h_addr_list[j][2]) &&
- (specified_local_addr_list[i][3] ==
+ (specified_local_addr_list[i][3] ==
hostp->h_addr_list[j][3]))
{
/* They're equal, so we're done */
-
+
equiv = 1;
break;
}
@@ -1951,7 +1951,7 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
#endif
PRMSG (2,"SocketUNIXConnect(%d,%s,%s)\n", ciptr->fd, host, port);
-
+
/*
* Make sure 'host' is really local. If not, we return failure.
* The reason we make this check is because a process may advertise
@@ -1983,7 +1983,7 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
/*
* Build the socket name.
*/
-
+
sockname.sun_family = AF_UNIX;
if (set_sun_path(port, UNIX_PATH, sockname.sun_path, abstract) != 0) {
@@ -1991,7 +1991,7 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
return TRANS_CONNECT_FAILED;
}
-#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__))
+#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__))
sockname.sun_len = strlen (sockname.sun_path);
#endif
@@ -2020,11 +2020,11 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
{
int olderrno = errno;
int connected = 0;
-
+
if (!connected)
{
errno = olderrno;
-
+
/*
* If the error was ENOENT, the server may be starting up; we used
* to suggest to try again in this case with
@@ -2106,7 +2106,7 @@ TRANS(SocketBytesReadable) (XtransConnInfo ciptr, BytesReadable_t *pend)
return ret;
}
#else
-#if defined(__i386__) && defined(SYSV) && !defined(SCO325)
+#if defined(__i386__) && defined(SYSV) && !defined(SCO325)
return ioctl (ciptr->fd, I_NREAD, (char *) pend);
#else
return ioctl (ciptr->fd, FIONREAD, (char *) pend);
@@ -2121,7 +2121,7 @@ TRANS(SocketRead) (XtransConnInfo ciptr, char *buf, int size)
{
PRMSG (2,"SocketRead(%d,%p,%d)\n", ciptr->fd, buf, size);
-#if defined(WIN32)
+#if defined(WIN32)
{
int ret = recv ((SOCKET)ciptr->fd, buf, size, 0);
#ifdef WIN32
@@ -2141,7 +2141,7 @@ TRANS(SocketWrite) (XtransConnInfo ciptr, char *buf, int size)
{
PRMSG (2,"SocketWrite(%d,%p,%d)\n", ciptr->fd, buf, size);
-#if defined(WIN32)
+#if defined(WIN32)
{
int ret = send ((SOCKET)ciptr->fd, buf, size, 0);
#ifdef WIN32
@@ -2182,7 +2182,7 @@ TRANS(SocketDisconnect) (XtransConnInfo ciptr)
PRMSG (2,"SocketDisconnect(%p,%d)\n", ciptr, ciptr->fd, 0);
#ifdef WIN32
- {
+ {
int ret = shutdown (ciptr->fd, 2);
if (ret == SOCKET_ERROR) errno = WSAGetLastError();
return ret;
@@ -2449,7 +2449,7 @@ Xtransport TRANS(SocketLocalFuncs) = {
static char* unix_nolisten[] = { "local" , NULL };
# endif
# endif
-
+
Xtransport TRANS(SocketUNIXFuncs) = {
/* Socket Interface */
"unix",
diff --git a/Xtranstli.c b/Xtranstli.c
index a9dfc21..f35214c 100644
--- a/Xtranstli.c
+++ b/Xtranstli.c
@@ -75,33 +75,33 @@ static TLItrans2dev TLItrans2devtab[] = {
};
#define NUMTLIFAMILIES (sizeof(TLItrans2devtab)/sizeof(TLItrans2dev))
-
+
/*
* The local TLI connection, is a form of a local connection, so use a
* sockaddr_un for the address so that it will be treated just like the other
* local transports such as UNIX domain sockets, pts, and named.
*/
-
+
#if defined(X11_t)
#define TLINODENAME "TLI:xserver"
#endif
-
+
#if defined(XIM_t)
#define TLINODENAME "TLI:xim"
#endif
-
+
#if defined(FS_t) || defined(FONT_t)
#define TLINODENAME "TLI:fontserver"
#endif
-
+
#if defined(ICE_t)
#define TLINODENAME "TLI:ICE"
#endif
-
+
#if defined(TEST_t)
#define TLINODENAME "TLI:test"
#endif
-
+
#ifndef PORTBUFSIZE
#ifdef TRANS_SERVER
#define PORTBUFSIZE 64
@@ -122,9 +122,9 @@ TRANS(TLISelectFamily)(char *family)
{
int i;
-
+
PRMSG(3,"TLISelectFamily(%s)\n", family, 0,0 );
-
+
for(i=0;i<NUMTLIFAMILIES;i++)
{
if( !strcmp(family,TLItrans2devtab[i].transname) )
@@ -145,41 +145,41 @@ TRANS(TLIGetAddr)(XtransConnInfo ciptr)
{
Xtransaddr sockname;
struct netbuf netbuf;
-
+
PRMSG(3,"TLIGetAddr(%x)\n", ciptr, 0,0 );
-
+
netbuf.buf=(char *)&sockname;
netbuf.len=sizeof(sockname);
netbuf.maxlen=sizeof(sockname);
-
+
if( t_getname(ciptr->fd,&netbuf,LOCALNAME) < 0 )
{
PRMSG(1,"TLIGetAddr: t_getname(LOCALNAME) failed: %d\n",
errno, 0,0 );
return -1;
}
-
+
PRMSG(4,"TLIGetAddr: got family %d len %d\n",
((struct sockaddr *) &sockname)->sa_family ,netbuf.len, 0 );
-
+
/*
* Everything looks good: fill in the XtransConnInfo structure.
*/
-
+
if( ciptr->addr )
xfree(ciptr->addr);
-
+
if( (ciptr->addr=(char *)xalloc(netbuf.len)) == NULL )
{
PRMSG(1, "TLIGetAddr: Can't allocate space for the addr\n",
0,0,0);
return -1;
}
-
+
ciptr->family=((struct sockaddr *) &sockname)->sa_family;
ciptr->addrlen=netbuf.len;
memcpy(ciptr->addr,&sockname,ciptr->addrlen);
-
+
return 0;
}
@@ -195,30 +195,30 @@ TRANS(TLIGetPeerAddr)(XtransConnInfo ciptr)
{
Xtransaddr sockname;
struct netbuf netbuf;
-
+
PRMSG(3,"TLIGetPeerAddr(%x)\n", ciptr, 0,0 );
-
+
netbuf.buf=(char *)&sockname;
netbuf.len=sizeof(sockname);
netbuf.maxlen=sizeof(sockname);
-
+
if( t_getname(ciptr->fd,&netbuf,REMOTENAME) < 0 )
{
PRMSG(1,"TLIGetPeerAddr: t_getname(REMOTENAME) failed: %d\n",
errno, 0,0 );
return -1;
}
-
+
PRMSG(4,"TLIGetPeerAddr: got family %d len %d\n",
((struct sockaddr *) &sockname)->sa_family ,netbuf.len, 0 );
-
+
/*
* Everything looks good: fill in the XtransConnInfo structure.
*/
-
+
if( ciptr->peeraddr )
xfree(ciptr->peeraddr);
-
+
if( (ciptr->peeraddr=(char *)xalloc(netbuf.len)) == NULL )
{
PRMSG(1,
@@ -226,10 +226,10 @@ TRANS(TLIGetPeerAddr)(XtransConnInfo ciptr)
0,0,0);
return -1;
}
-
+
ciptr->peeraddrlen=netbuf.len;
memcpy(ciptr->peeraddr,&sockname,ciptr->peeraddrlen);
-
+
return 0;
}
@@ -250,9 +250,9 @@ TRANS(TLITLIBindLocal)(int fd, int family, char *port)
{
struct sockaddr_un *sunaddr=NULL;
struct t_bind *req=NULL;
-
+
PRMSG(2, "TLITLIBindLocal(%d,%d,%s)\n", fd, family, port);
-
+
if( family == AF_UNIX )
{
if( (req=(struct t_bind *)t_alloc(fd,T_BIND,0)) == NULL )
@@ -262,7 +262,7 @@ TRANS(TLITLIBindLocal)(int fd, int family, char *port)
0,0,0 );
return -1;
}
-
+
if( (sunaddr=(struct sockaddr_un *)
malloc(sizeof(struct sockaddr_un))) == NULL )
{
@@ -272,9 +272,9 @@ TRANS(TLITLIBindLocal)(int fd, int family, char *port)
t_free((char *)req,T_BIND);
return -1;
}
-
+
sunaddr->sun_family=AF_UNIX;
-
+
#ifdef nuke
if( *port == '/' ) { /* A full pathname */
(void) strcpy(sunaddr->sun_path, port);
@@ -282,18 +282,18 @@ TRANS(TLITLIBindLocal)(int fd, int family, char *port)
(void) sprintf(sunaddr->sun_path,"%s%s", TLINODENAME, port );
}
#endif /*NUKE*/
-
+
(void) sprintf(sunaddr->sun_path,"%s%d",
TLINODENAME, getpid()^time(NULL) );
-
+
PRMSG(4, "TLITLIBindLocal: binding to %s\n",
sunaddr->sun_path, 0,0);
-
+
req->addr.buf=(char *)sunaddr;
req->addr.len=sizeof(*sunaddr);
req->addr.maxlen=sizeof(*sunaddr);
}
-
+
if( t_bind(fd, req, NULL) < 0 )
{
PRMSG(1,
@@ -313,22 +313,22 @@ TRANS(TLIOpen)(char *device)
{
XtransConnInfo ciptr;
-
+
PRMSG(3,"TLIOpen(%s)\n", device, 0,0 );
-
+
if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL )
{
PRMSG(1, "TLIOpen: calloc failed\n", 0,0,0 );
return NULL;
}
-
+
if( (ciptr->fd=t_open( device, O_RDWR, NULL )) < 0 )
{
PRMSG(1, "TLIOpen: t_open failed for %s\n", device, 0,0 );
free(ciptr);
return NULL;
}
-
+
return ciptr;
}
@@ -340,9 +340,9 @@ TRANS(TLIReopen)(char *device, int fd, char *port)
{
XtransConnInfo ciptr;
-
+
PRMSG(3,"TLIReopen(%s,%d, %s)\n", device, fd, port );
-
+
if (t_sync (fd) < 0)
{
PRMSG(1, "TLIReopen: t_sync failed\n", 0,0,0 );
@@ -354,9 +354,9 @@ TRANS(TLIReopen)(char *device, int fd, char *port)
PRMSG(1, "TLIReopen: calloc failed\n", 0,0,0 );
return NULL;
}
-
+
ciptr->fd = fd;
-
+
return ciptr;
}
@@ -364,7 +364,7 @@ TRANS(TLIReopen)(char *device, int fd, char *port)
static int
-TRANS(TLIAddrToNetbuf)(int tlifamily, char *host, char *port,
+TRANS(TLIAddrToNetbuf)(int tlifamily, char *host, char *port,
struct netbuf *netbufp)
{
@@ -373,23 +373,23 @@ TRANS(TLIAddrToNetbuf)(int tlifamily, char *host, char *port,
struct nd_addrlist *nd_addrlistp = NULL;
void *handlep;
long lport;
-
+
PRMSG(3,"TLIAddrToNetbuf(%d,%s,%s)\n", tlifamily, host, port );
-
+
if( (handlep=setnetconfig()) == NULL )
return -1;
lport = strtol (port, (char**)NULL, 10);
if (lport < 1024 || lport > USHRT_MAX)
return -1;
-
+
nd_hostserv.h_host = host;
if( port && *port ) {
nd_hostserv.h_serv = port;
} else {
nd_hostserv.h_serv = NULL;
}
-
+
while( (netconfigp=getnetconfig(handlep)) != NULL )
{
if( strcmp(netconfigp->nc_protofmly,
@@ -400,11 +400,11 @@ TRANS(TLIAddrToNetbuf)(int tlifamily, char *host, char *port,
if( netdir_getbyname(netconfigp,&nd_hostserv, &nd_addrlistp) == 0 )
{
/* we have at least one address to use */
-
+
PRMSG(5, "TLIAddrToNetbuf: found address for %s.%s\n", host, port, 0 );
PRMSG(5, "TLIAddrToNetbuf: %s\n",taddr2uaddr(netconfigp,nd_addrlistp->n_addrs),
0,0 );
-
+
memcpy(netbufp->buf,nd_addrlistp->n_addrs->buf,
nd_addrlistp->n_addrs->len);
netbufp->len=nd_addrlistp->n_addrs->len;
@@ -413,7 +413,7 @@ TRANS(TLIAddrToNetbuf)(int tlifamily, char *host, char *port,
}
}
endnetconfig(handlep);
-
+
return -1;
}
@@ -424,29 +424,29 @@ TRANS(TLIAddrToNetbuf)(int tlifamily, char *host, char *port,
#ifdef TRANS_CLIENT
static XtransConnInfo
-TRANS(TLIOpenCOTSClient)(Xtransport *thistrans, char *protocol,
+TRANS(TLIOpenCOTSClient)(Xtransport *thistrans, char *protocol,
char *host, char *port)
{
XtransConnInfo ciptr;
int i;
-
+
PRMSG(2,"TLIOpenCOTSClient(%s,%s,%s)\n", protocol, host, port );
-
+
if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 )
{
PRMSG(1,"TLIOpenCOTSClient: Unable to determine device for %s\n",
thistrans->TransName, 0,0 );
return NULL;
}
-
+
if( (ciptr=TRANS(TLIOpen)(TLItrans2devtab[i].devcotsname)) == NULL )
{
PRMSG(1,"TLIOpenCOTSClient: Unable to open device for %s\n",
thistrans->TransName, 0,0 );
return NULL;
}
-
+
if( TRANS(TLITLIBindLocal)(ciptr->fd,TLItrans2devtab[i].family,port) < 0 )
{
PRMSG(1,
@@ -456,7 +456,7 @@ TRANS(TLIOpenCOTSClient)(Xtransport *thistrans, char *protocol,
xfree(ciptr);
return NULL;
}
-
+
if( TRANS(TLIGetAddr)(ciptr) < 0 )
{
PRMSG(1,
@@ -466,10 +466,10 @@ TRANS(TLIOpenCOTSClient)(Xtransport *thistrans, char *protocol,
xfree(ciptr);
return NULL;
}
-
+
/* Save the TLIFamily for later use in TLIAddrToNetbuf() lookups */
ciptr->index = i;
-
+
return ciptr;
}
@@ -479,15 +479,15 @@ TRANS(TLIOpenCOTSClient)(Xtransport *thistrans, char *protocol,
#ifdef TRANS_SERVER
static XtransConnInfo
-TRANS(TLIOpenCOTSServer)(Xtransport *thistrans, char *protocol,
+TRANS(TLIOpenCOTSServer)(Xtransport *thistrans, char *protocol,
char *host, char *port)
{
XtransConnInfo ciptr;
int i;
-
+
PRMSG(2,"TLIOpenCOTSServer(%s,%s,%s)\n", protocol, host, port );
-
+
if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 )
{
PRMSG(1,
@@ -495,7 +495,7 @@ TRANS(TLIOpenCOTSServer)(Xtransport *thistrans, char *protocol,
thistrans->TransName, 0,0 );
return NULL;
}
-
+
if( (ciptr=TRANS(TLIOpen)(TLItrans2devtab[i].devcotsname)) == NULL )
{
PRMSG(1,
@@ -503,16 +503,16 @@ TRANS(TLIOpenCOTSServer)(Xtransport *thistrans, char *protocol,
thistrans->TransName, 0,0 );
return NULL;
}
-
+
/* Set the family type */
ciptr->family = TLItrans2devtab[i].family;
/* Save the TLIFamily for later use in TLIAddrToNetbuf() lookups */
-
+
ciptr->index = i;
-
+
return ciptr;
}
@@ -522,15 +522,15 @@ TRANS(TLIOpenCOTSServer)(Xtransport *thistrans, char *protocol,
#ifdef TRANS_CLIENT
static XtransConnInfo
-TRANS(TLIOpenCLTSClient)(Xtransport *thistrans, char *protocol,
+TRANS(TLIOpenCLTSClient)(Xtransport *thistrans, char *protocol,
char *host, char *port)
{
XtransConnInfo ciptr;
int i;
-
+
PRMSG(2,"TLIOpenCLTSClient(%s,%s,%s)\n", protocol, host, port );
-
+
if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 )
{
PRMSG(1,
@@ -538,7 +538,7 @@ TRANS(TLIOpenCLTSClient)(Xtransport *thistrans, char *protocol,
thistrans->TransName, 0,0 );
return NULL;
}
-
+
if( (ciptr=TRANS(TLIOpen)(TLItrans2devtab[i].devcltsname)) == NULL )
{
PRMSG(1,
@@ -546,7 +546,7 @@ TRANS(TLIOpenCLTSClient)(Xtransport *thistrans, char *protocol,
thistrans->TransName, 0,0 );
return NULL;
}
-
+
if( TRANS(TLITLIBindLocal)(ciptr->fd,TLItrans2devtab[i].family,port) < 0 )
{
PRMSG(1,
@@ -556,7 +556,7 @@ TRANS(TLIOpenCLTSClient)(Xtransport *thistrans, char *protocol,
xfree(ciptr);
return NULL;
}
-
+
if( TRANS(TLIGetAddr)(ciptr) < 0 )
{
PRMSG(1,
@@ -566,9 +566,9 @@ TRANS(TLIOpenCLTSClient)(Xtransport *thistrans, char *protocol,
xfree(ciptr);
return NULL;
}
-
+
return ciptr;
-}
+}
#endif /* TRANS_CLIENT */
@@ -576,15 +576,15 @@ TRANS(TLIOpenCLTSClient)(Xtransport *thistrans, char *protocol,
#ifdef TRANS_SERVER
static XtransConnInfo
-TRANS(TLIOpenCLTSServer)(Xtransport *thistrans, char *protocol,
+TRANS(TLIOpenCLTSServer)(Xtransport *thistrans, char *protocol,
char *host, char *port)
{
XtransConnInfo ciptr;
int i;
-
+
PRMSG(2,"TLIOpenCLTSServer(%s,%s,%s)\n", protocol, host, port );
-
+
if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 )
{
PRMSG(1,
@@ -592,7 +592,7 @@ TRANS(TLIOpenCLTSServer)(Xtransport *thistrans, char *protocol,
thistrans->TransName, 0,0 );
return NULL;
}
-
+
if( (ciptr=TRANS(TLIOpen)(TLItrans2devtab[i].devcltsname)) == NULL )
{
PRMSG(1,
@@ -600,9 +600,9 @@ TRANS(TLIOpenCLTSServer)(Xtransport *thistrans, char *protocol,
thistrans->TransName, 0,0 );
return NULL;
}
-
+
return ciptr;
-}
+}
#endif /* TRANS_SERVER */
@@ -615,9 +615,9 @@ TRANS(TLIReopenCOTSServer)(Xtransport *thistrans, int fd, char *port)
{
XtransConnInfo ciptr;
int i;
-
+
PRMSG(2,"TLIReopenCOTSServer(%d, %s)\n", fd, port, 0 );
-
+
if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 )
{
PRMSG(1,
@@ -634,11 +634,11 @@ TRANS(TLIReopenCOTSServer)(Xtransport *thistrans, int fd, char *port)
thistrans->TransName, 0,0 );
return NULL;
}
-
+
/* Save the TLIFamily for later use in TLIAddrToNetbuf() lookups */
-
+
ciptr->index = i;
-
+
return ciptr;
}
@@ -649,9 +649,9 @@ TRANS(TLIReopenCLTSServer)(Xtransport *thistrans, int fd, char *port)
{
XtransConnInfo ciptr;
int i;
-
+
PRMSG(2,"TLIReopenCLTSServer(%d, %s)\n", fd, port, 0 );
-
+
if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 )
{
PRMSG(1,
@@ -668,11 +668,11 @@ TRANS(TLIReopenCLTSServer)(Xtransport *thistrans, int fd, char *port)
thistrans->TransName, 0,0 );
return NULL;
}
-
+
ciptr->index = i;
return ciptr;
-}
+}
#endif /* TRANS_REOPEN */
@@ -682,7 +682,7 @@ TRANS(TLISetOption)(XtransConnInfo ciptr, int option, int arg)
{
PRMSG(2,"TLISetOption(%d,%d,%d)\n", ciptr->fd, option, arg );
-
+
return -1;
}
@@ -694,9 +694,9 @@ TRANS(TLICreateListener)(XtransConnInfo ciptr, struct t_bind *req)
{
struct t_bind *ret;
-
+
PRMSG(2,"TLICreateListener(%x->%d,%x)\n", ciptr, ciptr->fd, req );
-
+
if( (ret=(struct t_bind *)t_alloc(ciptr->fd,T_BIND,T_ALL)) == NULL )
{
PRMSG(1, "TLICreateListener: failed to allocate a t_bind\n",
@@ -704,7 +704,7 @@ TRANS(TLICreateListener)(XtransConnInfo ciptr, struct t_bind *req)
t_free((char *)req,T_BIND);
return TRANS_CREATE_LISTENER_FAILED;
}
-
+
if( t_bind(ciptr->fd, req, ret) < 0 )
{
PRMSG(1, "TLICreateListener: t_bind failed\n", 0,0,0 );
@@ -712,7 +712,7 @@ TRANS(TLICreateListener)(XtransConnInfo ciptr, struct t_bind *req)
t_free((char *)ret,T_BIND);
return TRANS_CREATE_LISTENER_FAILED;
}
-
+
if( memcmp(req->addr.buf,ret->addr.buf,req->addr.len) != 0 )
{
PRMSG(1, "TLICreateListener: unable to bind to %x\n",
@@ -721,11 +721,11 @@ TRANS(TLICreateListener)(XtransConnInfo ciptr, struct t_bind *req)
t_free((char *)ret,T_BIND);
return TRANS_ADDR_IN_USE;
}
-
+
/*
* Everything looks good: fill in the XtransConnInfo structure.
*/
-
+
if( (ciptr->addr=(char *)xalloc(ret->addr.len)) == NULL )
{
PRMSG(1,
@@ -735,13 +735,13 @@ TRANS(TLICreateListener)(XtransConnInfo ciptr, struct t_bind *req)
t_free((char *)ret, T_BIND);
return TRANS_CREATE_LISTENER_FAILED;
}
-
+
ciptr->addrlen=ret->addr.len;
memcpy(ciptr->addr,ret->addr.buf,ret->addr.len);
-
+
t_free((char *)req,T_BIND);
t_free((char *)ret, T_BIND);
-
+
return 0;
}
@@ -754,10 +754,10 @@ TRANS(TLIINETCreateListener)(XtransConnInfo ciptr, char *port, unsigned int flag
struct t_bind *req;
struct sockaddr_in *sinaddr;
long tmpport;
-
+
PRMSG(2,"TLIINETCreateListener(%x->%d,%s)\n", ciptr,
ciptr->fd, port ? port : "NULL" );
-
+
#ifdef X11_t
/*
* X has a well known port, that is transport dependent. It is easier
@@ -767,7 +767,7 @@ TRANS(TLIINETCreateListener)(XtransConnInfo ciptr, char *port, unsigned int flag
* The port that is passed here is really a string containing the idisplay
* from ConnectDisplay().
*/
-
+
if (is_numeric (port))
{
tmpport = X_TCP_PORT + strtol (port, (char**)NULL, 10);
@@ -775,7 +775,7 @@ TRANS(TLIINETCreateListener)(XtransConnInfo ciptr, char *port, unsigned int flag
port = portbuf;
}
#endif
-
+
if( (req=(struct t_bind *)t_alloc(ciptr->fd,T_BIND,T_ALL)) == NULL )
{
PRMSG(1,
@@ -803,7 +803,7 @@ TRANS(TLIINETCreateListener)(XtransConnInfo ciptr, char *port, unsigned int flag
/* Set the qlen */
req->qlen=1;
-
+
return TRANS(TLICreateListener)(ciptr, req);
}
@@ -815,10 +815,10 @@ TRANS(TLITLICreateListener)(XtransConnInfo ciptr, char *port, unsigned int flags
struct t_bind *req;
struct sockaddr_un *sunaddr;
int ret_value;
-
+
PRMSG(2,"TLITLICreateListener(%x->%d,%s)\n", ciptr, ciptr->fd,
port ? port : "NULL");
-
+
if( (req=(struct t_bind *)t_alloc(ciptr->fd,T_BIND,0)) == NULL )
{
PRMSG(1,
@@ -826,7 +826,7 @@ TRANS(TLITLICreateListener)(XtransConnInfo ciptr, char *port, unsigned int flags
0,0,0 );
return TRANS_CREATE_LISTENER_FAILED;
}
-
+
if( (sunaddr=(struct sockaddr_un *)
malloc(sizeof(struct sockaddr_un))) == NULL )
{
@@ -836,7 +836,7 @@ TRANS(TLITLICreateListener)(XtransConnInfo ciptr, char *port, unsigned int flags
t_free((char *)req,T_BIND);
return TRANS_CREATE_LISTENER_FAILED;
}
-
+
sunaddr->sun_family=AF_UNIX;
if( port && *port ) {
if( *port == '/' ) { /* A full pathname */
@@ -847,15 +847,15 @@ TRANS(TLITLICreateListener)(XtransConnInfo ciptr, char *port, unsigned int flags
} else {
(void) sprintf(sunaddr->sun_path,"%s%d", TLINODENAME, getpid());
}
-
+
req->addr.buf=(char *)sunaddr;
req->addr.len=sizeof(*sunaddr);
req->addr.maxlen=sizeof(*sunaddr);
-
+
/* Set the qlen */
-
+
req->qlen=1;
-
+
ret_value = TRANS(TLICreateListener)(ciptr, req);
free((char *) sunaddr);
@@ -871,16 +871,16 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
struct t_call *call;
XtransConnInfo newciptr;
int i;
-
+
PRMSG(2,"TLIAccept(%x->%d)\n", ciptr, ciptr->fd, 0 );
-
+
if( (call=(struct t_call *)t_alloc(ciptr->fd,T_CALL,T_ALL)) == NULL )
{
PRMSG(1, "TLIAccept() failed to allocate a t_call\n", 0,0,0 );
*status = TRANS_ACCEPT_BAD_MALLOC;
return NULL;
}
-
+
if( t_listen(ciptr->fd,call) < 0 )
{
extern char *t_errlist[];
@@ -891,13 +891,13 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
*status = TRANS_ACCEPT_MISC_ERROR;
return NULL;
}
-
+
/*
* Now we need to set up the new endpoint for the incoming connection.
*/
-
+
i=ciptr->index; /* Makes the next line more readable */
-
+
if( (newciptr=TRANS(TLIOpen)(TLItrans2devtab[i].devcotsname)) == NULL )
{
PRMSG(1, "TLIAccept() failed to open a new endpoint\n", 0,0,0 );
@@ -905,7 +905,7 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
*status = TRANS_ACCEPT_MISC_ERROR;
return NULL;
}
-
+
if( TRANS(TLITLIBindLocal)(newciptr->fd,TLItrans2devtab[i].family,"") < 0 )
{
PRMSG(1,
@@ -917,8 +917,8 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
*status = TRANS_ACCEPT_MISC_ERROR;
return NULL;
}
-
-
+
+
if( t_accept(ciptr->fd,newciptr->fd,call) < 0 )
{
extern char *t_errlist[];
@@ -948,9 +948,9 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
*status = TRANS_ACCEPT_FAILED;
return NULL;
}
-
+
t_free((char *)call,T_CALL);
-
+
if( TRANS(TLIGetAddr)(newciptr) < 0 )
{
PRMSG(1,
@@ -961,7 +961,7 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
*status = TRANS_ACCEPT_MISC_ERROR;
return NULL;
}
-
+
if( TRANS(TLIGetPeerAddr)(newciptr) < 0 )
{
PRMSG(1,
@@ -973,7 +973,7 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
*status = TRANS_ACCEPT_MISC_ERROR;
return NULL;
}
-
+
if( ioctl(newciptr->fd, I_POP,"timod") < 0 )
{
PRMSG(1, "TLIAccept() ioctl(I_POP, \"timod\") failed %d\n",
@@ -984,7 +984,7 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
*status = TRANS_ACCEPT_MISC_ERROR;
return NULL;
}
-
+
if( ioctl(newciptr->fd, I_PUSH,"tirdwr") < 0 )
{
PRMSG(1, "TLIAccept() ioctl(I_PUSH,\"tirdwr\") failed %d\n",
@@ -995,7 +995,7 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
*status = TRANS_ACCEPT_MISC_ERROR;
return NULL;
}
-
+
*status = 0;
return newciptr;
@@ -1011,7 +1011,7 @@ TRANS(TLIConnect)(XtransConnInfo ciptr, struct t_call *sndcall )
{
PRMSG(2, "TLIConnect(%x->%d,%x)\n", ciptr, ciptr->fd, sndcall);
-
+
if( t_connect(ciptr->fd,sndcall,NULL) < 0 )
{
extern char *t_errlist[];
@@ -1027,13 +1027,13 @@ TRANS(TLIConnect)(XtransConnInfo ciptr, struct t_call *sndcall )
else
return TRANS_CONNECT_FAILED;
}
-
+
t_free((char *)sndcall,T_CALL);
-
+
/*
* Sync up the address fields of ciptr.
*/
-
+
if( TRANS(TLIGetAddr)(ciptr) < 0 )
{
PRMSG(1,
@@ -1041,7 +1041,7 @@ TRANS(TLIConnect)(XtransConnInfo ciptr, struct t_call *sndcall )
errno, 0,0 );
return TRANS_CONNECT_FAILED;
}
-
+
if( TRANS(TLIGetPeerAddr)(ciptr) < 0 )
{
PRMSG(1,
@@ -1049,21 +1049,21 @@ TRANS(TLIConnect)(XtransConnInfo ciptr, struct t_call *sndcall )
errno, 0,0 );
return TRANS_CONNECT_FAILED;
}
-
+
if( ioctl(ciptr->fd, I_POP,"timod") < 0 )
{
PRMSG(1, "TLIConnect() ioctl(I_POP,\"timod\") failed %d\n",
errno,0,0 );
return TRANS_CONNECT_FAILED;
}
-
+
if( ioctl(ciptr->fd, I_PUSH,"tirdwr") < 0 )
{
PRMSG(1, "TLIConnect() ioctl(I_PUSH,\"tirdwr\") failed %d\n",
errno,0,0 );
return TRANS_CONNECT_FAILED;
}
-
+
return 0;
}
@@ -1072,12 +1072,12 @@ static int
TRANS(TLIINETConnect)(XtransConnInfo ciptr, char *host, char *port)
{
- char portbuf[PORTBUFSIZE];
+ char portbuf[PORTBUFSIZE];
struct t_call *sndcall;
long tmpport;
-
+
PRMSG(2, "TLIINETConnect(%s,%s)\n", host, port, 0);
-
+
#ifdef X11_t
/*
* X has a well known port, that is transport dependant. It is easier
@@ -1087,7 +1087,7 @@ TRANS(TLIINETConnect)(XtransConnInfo ciptr, char *host, char *port)
* The port that is passed here is really a string containing the idisplay
* from ConnectDisplay().
*/
-
+
if (is_numeric (port))
{
tmpport = X_TCP_PORT + strtol (port, (char**)NULL, 10);
@@ -1095,13 +1095,13 @@ TRANS(TLIINETConnect)(XtransConnInfo ciptr, char *host, char *port)
port = portbuf;
}
#endif
-
+
if( (sndcall=(struct t_call *)t_alloc(ciptr->fd,T_CALL,T_ALL)) == NULL )
{
PRMSG(1, "TLIINETConnect() failed to allocate a t_call\n", 0,0,0 );
return TRANS_CONNECT_FAILED;
}
-
+
if( TRANS(TLIAddrToNetbuf)(ciptr->index, host, port, &(sndcall->addr) ) < 0 )
{
PRMSG(1, "TLIINETConnect() unable to resolve name:%s.%s\n",
@@ -1109,7 +1109,7 @@ TRANS(TLIINETConnect)(XtransConnInfo ciptr, char *host, char *port)
t_free((char *)sndcall,T_CALL);
return TRANS_CONNECT_FAILED;
}
-
+
return TRANS(TLIConnect)(ciptr, sndcall );
}
@@ -1121,15 +1121,15 @@ TRANS(TLITLIConnect)(XtransConnInfo ciptr, char *host, char *port)
struct t_call *sndcall;
struct sockaddr_un *sunaddr;
int ret_value;
-
+
PRMSG(2, "TLITLIConnect(%s,%s)\n", host, port, 0);
-
+
if( (sndcall=(struct t_call *)t_alloc(ciptr->fd,T_CALL,T_OPT|T_UDATA)) == NULL )
{
PRMSG(1, "TLITLIConnect() failed to allocate a t_call\n", 0,0,0 );
return TRANS_CONNECT_FAILED;
}
-
+
if( (sunaddr=(struct sockaddr_un *)
malloc(sizeof(struct sockaddr_un))) == NULL )
{
@@ -1139,7 +1139,7 @@ TRANS(TLITLIConnect)(XtransConnInfo ciptr, char *host, char *port)
t_free((char *)sndcall,T_CALL);
return TRANS_CONNECT_FAILED;
}
-
+
sunaddr->sun_family=AF_UNIX;
if( *port == '/' ||
strncmp (port, TLINODENAME, strlen (TLINODENAME)) == 0) {
@@ -1152,7 +1152,7 @@ TRANS(TLITLIConnect)(XtransConnInfo ciptr, char *host, char *port)
sndcall->addr.buf=(char *)sunaddr;
sndcall->addr.len=sizeof(*sunaddr);
sndcall->addr.maxlen=sizeof(*sunaddr);
-
+
ret_value = TRANS(TLIConnect)(ciptr, sndcall );
free((char *) sunaddr);
@@ -1178,7 +1178,7 @@ TRANS(TLIBytesReadable)(XtransConnInfo ciptr, BytesReadable_t *pend)
* streams head, and ioctl(N_READ) keeps returning 0 because there is
* no data available. The hangup goes undetected, and the client hangs.
*/
-
+
ret=ioctl(ciptr->fd, I_NREAD, (char *)pend);
if( ret != 0 )
@@ -1191,7 +1191,7 @@ TRANS(TLIBytesReadable)(XtransConnInfo ciptr, BytesReadable_t *pend)
filedes.events=POLLIN;
ret=poll(&filedes, 1, 0);
-
+
if( ret == 0 ) {
*pend=0;
return 0; /* Really, no data */
@@ -1213,7 +1213,7 @@ TRANS(TLIRead)(XtransConnInfo ciptr, char *buf, int size)
{
PRMSG(2, "TLIRead(%d,%x,%d)\n", ciptr->fd, buf, size );
-
+
return read(ciptr->fd,buf,size);
}
@@ -1223,7 +1223,7 @@ TRANS(TLIWrite)(XtransConnInfo ciptr, char *buf, int size)
{
PRMSG(2, "TLIWrite(%d,%x,%d)\n", ciptr->fd, buf, size );
-
+
return write(ciptr->fd,buf,size);
}
@@ -1233,7 +1233,7 @@ TRANS(TLIReadv)(XtransConnInfo ciptr, struct iovec *buf, int size)
{
PRMSG(2, "TLIReadv(%d,%x,%d)\n", ciptr->fd, buf, size );
-
+
return READV(ciptr,buf,size);
}
@@ -1243,7 +1243,7 @@ TRANS(TLIWritev)(XtransConnInfo ciptr, struct iovec *buf, int size)
{
PRMSG(2, "TLIWritev(%d,%x,%d)\n", ciptr->fd, buf, size );
-
+
return WRITEV(ciptr,buf,size);
}
@@ -1253,7 +1253,7 @@ TRANS(TLIDisconnect)(XtransConnInfo ciptr)
{
PRMSG(2, "TLIDisconnect(%x->%d)\n", ciptr, ciptr->fd, 0 );
-
+
/*
* Restore the TLI modules so that the connection can be properly shutdown.
* This avoids the situation where a connection goes into the TIME_WAIT
@@ -1263,7 +1263,7 @@ TRANS(TLIDisconnect)(XtransConnInfo ciptr)
ioctl(ciptr->fd, I_PUSH,"timod");
t_snddis(ciptr->fd,NULL);
-
+
return 0;
}
@@ -1273,7 +1273,7 @@ TRANS(TLIClose)(XtransConnInfo ciptr)
{
PRMSG(2, "TLIClose(%x->%d)\n", ciptr, ciptr->fd, 0 );
-
+
t_unbind(ciptr->fd);
return (t_close(ciptr->fd));
@@ -1289,7 +1289,7 @@ TRANS(TLICloseForCloning)(XtransConnInfo ciptr)
*/
PRMSG(2, "TLICloseForCloning(%x->%d)\n", ciptr, ciptr->fd, 0 );
-
+
return (t_close(ciptr->fd));
}
diff --git a/Xtransutil.c b/Xtransutil.c
index 42f09c4..56f0158 100644
--- a/Xtransutil.c
+++ b/Xtransutil.c
@@ -142,7 +142,7 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp)
{
*familyp=FamilyLocal;
}
- else
+ else
{
*familyp=FamilyInternet;
*addrlenp = sizeof (struct in_addr);
@@ -161,7 +161,7 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp)
#endif /* defined(TCPCONN) || defined(STREAMSCONN) */
-#if defined(UNIXCONN) || defined(LOCALCONN)
+#if defined(UNIXCONN) || defined(LOCALCONN)
case AF_UNIX:
{
*familyp=FamilyLocal;
@@ -190,7 +190,7 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp)
* In the case of a local connection, we need to get the
* host name for authentication.
*/
-
+
char hostnamebuf[256];
int len = TRANS(GetHostname) (hostnamebuf, sizeof hostnamebuf);
@@ -251,7 +251,7 @@ TRANS(GetMyNetworkId) (XtransConnInfo ciptr)
switch (family)
{
-#if defined(UNIXCONN) || defined(STREAMSCONN) || defined(LOCALCONN)
+#if defined(UNIXCONN) || defined(STREAMSCONN) || defined(LOCALCONN)
case AF_UNIX:
{
struct sockaddr_un *saddr = (struct sockaddr_un *) addr;
@@ -341,7 +341,7 @@ TRANS(GetPeerNetworkId) (XtransConnInfo ciptr)
switch (family)
{
case AF_UNSPEC:
-#if defined(UNIXCONN) || defined(STREAMSCONN) || defined(LOCALCONN)
+#if defined(UNIXCONN) || defined(STREAMSCONN) || defined(LOCALCONN)
case AF_UNIX:
{
if (gethostname (addrbuf, sizeof (addrbuf)) == 0)
@@ -386,7 +386,7 @@ TRANS(GetPeerNetworkId) (XtransConnInfo ciptr)
* Assume that if it does not respond in NAMESERVER_TIMEOUT seconds
* that something is wrong and do not make the user wait.
* gethostbyaddr will continue after a signal, so we have to
- * jump out of it.
+ * jump out of it.
*/
nameserver_timedout = 0;
@@ -431,7 +431,7 @@ TRANS(GetPeerNetworkId) (XtransConnInfo ciptr)
#endif /* ICE_t */
-#if defined(WIN32) && defined(TCPCONN)
+#if defined(WIN32) && defined(TCPCONN)
int
TRANS(WSAStartup) (void)
{
@@ -478,7 +478,7 @@ is_numeric (const char *str)
* it's not save if the directory has non-root ownership or the sticky
* bit cannot be set and fail.
*/
-static int
+static int
trans_mkdir(const char *path, int mode)
{
struct stat buf;
@@ -501,7 +501,7 @@ trans_mkdir(const char *path, int mode)
if (mode & 01000) {
PRMSG(1, "mkdir: ERROR: euid != 0,"
"directory %s will not be created.\n",
- path, 0, 0);
+ path, 0, 0);
#ifdef FAIL_HARD
return -1;
#endif
@@ -531,7 +531,7 @@ trans_mkdir(const char *path, int mode)
}
return 0;
-
+
} else {
if (S_ISDIR(buf.st_mode)) {
int updateOwner = 0;
@@ -550,7 +550,7 @@ trans_mkdir(const char *path, int mode)
*/
if ((~mode) & 0077 & buf.st_mode)
updateMode = 1;
-
+
/*
* If the directory is not writeable not everybody may
* be able to create sockets. Therefore warn if mode
@@ -560,7 +560,7 @@ trans_mkdir(const char *path, int mode)
updateMode = 1;
status |= WARN_NO_ACCESS;
}
-
+
/*
* If 'sticky' bit is requested fail if owner isn't root
* as we assume the caller makes certain security implications
@@ -572,7 +572,7 @@ trans_mkdir(const char *path, int mode)
updateMode = 1;
}
}
-
+
#ifdef HAS_FCHOWN
/*
* If fchown(2) and fchmod(2) are available, try to correct the
@@ -607,7 +607,7 @@ trans_mkdir(const char *path, int mode)
}
}
#endif
-
+
if (updateOwner && !updatedOwner) {
#ifdef FAIL_HARD
if (status & FAIL_IF_NOT_ROOT) {
@@ -621,7 +621,7 @@ trans_mkdir(const char *path, int mode)
path, 0, 0);
#endif
}
-
+
if (updateMode && !updatedMode) {
#ifdef FAIL_HARD
if (status & FAIL_IF_NOMODE) {
diff --git a/configure.ac b/configure.ac
index 3b38d29..5f1743c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -51,7 +51,7 @@ AC_SUBST(fchown_define)
# sticky bit
#
-# if any system exists without sticky dir bits this
+# if any system exists without sticky dir bits this
# needs to be redone with a real autoconf test
sticky_bit_define="-DHAS_STICKY_DIR_BIT"
diff --git a/xtrans.m4 b/xtrans.m4
index da35a75..91c6f9d 100644
--- a/xtrans.m4
+++ b/xtrans.m4
@@ -33,9 +33,9 @@ AC_DEFUN([XTRANS_TCP_FLAGS],[
fi
# Needs to come after above checks for libsocket & libnsl for SVR4 systems
- AC_ARG_ENABLE(ipv6,
+ AC_ARG_ENABLE(ipv6,
AC_HELP_STRING([--enable-ipv6],[Enable IPv6 support]),
- [IPV6CONN=$enableval],
+ [IPV6CONN=$enableval],
[AC_CHECK_FUNC(getaddrinfo,[IPV6CONN=yes],[IPV6CONN=no])])
AC_MSG_CHECKING([if IPv6 support should be built])
if test "$IPV6CONN" = "yes"; then
@@ -44,7 +44,7 @@ AC_DEFUN([XTRANS_TCP_FLAGS],[
AC_MSG_RESULT($IPV6CONN)
# 4.3BSD-Reno added a new member to struct sockaddr_in
- AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
+ AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
AC_DEFINE([BSD44SOCKETS],1,
[Define to 1 if `struct sockaddr_in' has a `sin_len' member]), [], [
#include <sys/types.h>
@@ -56,7 +56,7 @@ AC_DEFUN([XTRANS_TCP_FLAGS],[
AC_CHECK_TYPES([socklen_t], [], [], [
AC_INCLUDES_DEFAULT
#include <sys/socket.h>])
-
+
]) # XTRANS_TCP_FLAGS
# XTRANS_CONNECTION_FLAGS()
@@ -78,7 +78,7 @@ AC_DEFUN([XTRANS_CONNECTION_FLAGS],[
AC_DEFINE(UNIXCONN,1,[Support UNIX socket connections])
fi
AC_MSG_RESULT($UNIXCONN)
- AC_ARG_ENABLE(tcp-transport,
+ AC_ARG_ENABLE(tcp-transport,
AC_HELP_STRING([--enable-tcp-transport],[Enable TCP socket transport]),
[TCPCONN=$enableval], [TCPCONN=yes])
AC_MSG_CHECKING([if Xtrans should support TCP socket connections])
@@ -99,7 +99,7 @@ AC_DEFUN([XTRANS_CONNECTION_FLAGS],[
if test "$LOCALCONN" = "yes"; then
AC_DEFINE(LOCALCONN,1,[Support os-specific local connections])
fi
-
+
]) # XTRANS_CONNECTION_FLAGS
@@ -109,7 +109,7 @@ AC_DEFUN([XTRANS_CONNECTION_FLAGS],[
# so that any necessary networking libraries are already found
AC_DEFUN([XTRANS_SECURE_RPC_FLAGS],
[AC_REQUIRE([XTRANS_TCP_FLAGS])
- AC_ARG_ENABLE(secure-rpc,
+ AC_ARG_ENABLE(secure-rpc,
AC_HELP_STRING([--enable-secure-rpc],[Enable Secure RPC]),
[SECURE_RPC=$enableval], [SECURE_RPC="try"])
@@ -120,7 +120,7 @@ AC_DEFUN([XTRANS_SECURE_RPC_FLAGS],
if test "x$FOUND_SECURE_RPC" = "xno" ; then
if test "x$SECURE_RPC" = "xyes" ; then
AC_MSG_ERROR([Secure RPC requested, but required functions not found])
- fi
+ fi
SECURE_RPC="no"
else
dnl FreeBSD keeps getsecretkey in librpcsvc