aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2016-10-13 00:51:03 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-11-02 19:46:36 +0100
commitc3f43e832a8062169f999f3a5c298fe3f40ab9e8 (patch)
tree66a22e5bcb425aac46cdffed61f6525402364051
parentc4b775f6dc6f8361dc27ace5d2b40ec42c3381bf (diff)
downloadnx-libs-c3f43e832a8062169f999f3a5c298fe3f40ab9e8.tar.gz
nx-libs-c3f43e832a8062169f999f3a5c298fe3f40ab9e8.tar.bz2
nx-libs-c3f43e832a8062169f999f3a5c298fe3f40ab9e8.zip
replace PRMSG by prmsg
-rw-r--r--nx-X11/lib/xtrans/Xtrans.c128
-rw-r--r--nx-X11/lib/xtrans/Xtransint.h105
-rw-r--r--nx-X11/lib/xtrans/Xtranslcl.c373
-rw-r--r--nx-X11/lib/xtrans/Xtranssock.c359
-rw-r--r--nx-X11/lib/xtrans/Xtransutil.c55
-rw-r--r--nx-X11/lib/xtrans/transport.c3
6 files changed, 499 insertions, 524 deletions
diff --git a/nx-X11/lib/xtrans/Xtrans.c b/nx-X11/lib/xtrans/Xtrans.c
index ee7d2f3cb..62e9dfa16 100644
--- a/nx-X11/lib/xtrans/Xtrans.c
+++ b/nx-X11/lib/xtrans/Xtrans.c
@@ -126,7 +126,7 @@ void
TRANS(FreeConnInfo) (XtransConnInfo ciptr)
{
- PRMSG (3,"FreeConnInfo(%p)\n", ciptr, 0, 0);
+ prmsg (3,"FreeConnInfo(%p)\n", ciptr);
if (ciptr->addr)
free (ciptr->addr);
@@ -150,7 +150,7 @@ TRANS(SelectTransport) (char *protocol)
char protobuf[PROTOBUFSIZE];
int i;
- PRMSG (3,"SelectTransport(%s)\n", protocol, 0, 0);
+ prmsg (3,"SelectTransport(%s)\n", protocol);
/*
* Force Protocol to be lowercase as a way of doing
@@ -200,7 +200,7 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port)
char hostnamebuf[256];
int _host_len;
- PRMSG (3,"ParseAddress(%s)\n", address, 0, 0);
+ prmsg (3,"ParseAddress(%s)\n", address);
/* Copy the string so it can be changed */
@@ -388,12 +388,12 @@ TRANS(Open) (int type, char *address)
XtransConnInfo ciptr = NULL;
Xtransport *thistrans;
- PRMSG (2,"Open(%d,%s)\n", type, address, 0);
+ prmsg (2,"Open(%d,%s)\n", type, address);
#if defined(WIN32) && defined(TCPCONN)
if (TRANS(WSAStartup)())
{
- PRMSG (1,"Open: WSAStartup failed\n", 0, 0, 0);
+ prmsg (1,"Open: WSAStartup failed\n");
return NULL;
}
#endif
@@ -402,7 +402,7 @@ TRANS(Open) (int type, char *address)
if (TRANS(ParseAddress) (address, &protocol, &host, &port) == 0)
{
- PRMSG (1,"Open: Unable to Parse address %s\n", address, 0, 0);
+ prmsg (1,"Open: Unable to Parse address %s\n", address);
return NULL;
}
@@ -410,8 +410,8 @@ TRANS(Open) (int type, char *address)
if ((thistrans = TRANS(SelectTransport) (protocol)) == NULL)
{
- PRMSG (1,"Open: Unable to find transport for %s\n",
- protocol, 0, 0);
+ prmsg (1,"Open: Unable to find transport for %s\n",
+ protocol);
free (protocol);
free (host);
@@ -444,14 +444,14 @@ TRANS(Open) (int type, char *address)
#endif /* TRANS_SERVER */
break;
default:
- PRMSG (1,"Open: Unknown Open type %d\n", type, 0, 0);
+ prmsg (1,"Open: Unknown Open type %d\n", type);
}
if (ciptr == NULL)
{
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);
}
free (protocol);
@@ -487,7 +487,7 @@ TRANS(Reopen) (int type, int trans_id, int fd, char *port)
char *save_port;
int i;
- PRMSG (2,"Reopen(%d,%d,%s)\n", trans_id, fd, port);
+ prmsg (2,"Reopen(%d,%d,%s)\n", trans_id, fd, port);
/* Determine the transport type */
@@ -500,15 +500,15 @@ TRANS(Reopen) (int type, int trans_id, int fd, char *port)
if (thistrans == NULL)
{
- PRMSG (1,"Reopen: Unable to find transport id %d\n",
- trans_id, 0, 0);
+ prmsg (1,"Reopen: Unable to find transport id %d\n",
+ trans_id);
return NULL;
}
if ((save_port = (char *) malloc (strlen (port) + 1)) == NULL)
{
- PRMSG (1,"Reopen: Unable to malloc port string\n", 0, 0, 0);
+ prmsg (1,"Reopen: Unable to malloc port string\n");
return NULL;
}
@@ -526,12 +526,12 @@ TRANS(Reopen) (int type, int trans_id, int fd, char *port)
ciptr = thistrans->ReopenCLTSServer(thistrans, fd, port);
break;
default:
- PRMSG (1,"Reopen: Bad Open type %d\n", type, 0, 0);
+ prmsg (1,"Reopen: Bad Open type %d\n", type);
}
if (ciptr == NULL)
{
- PRMSG (1,"Reopen: transport open failed\n", 0, 0, 0);
+ prmsg (1,"Reopen: transport open failed\n");
return NULL;
}
@@ -557,7 +557,7 @@ XtransConnInfo
TRANS(OpenCOTSClient) (char *address)
{
- PRMSG (2,"OpenCOTSClient(%s)\n", address, 0, 0);
+ prmsg (2,"OpenCOTSClient(%s)\n", address);
return TRANS(Open) (XTRANS_OPEN_COTS_CLIENT, address);
}
@@ -570,7 +570,7 @@ XtransConnInfo
TRANS(OpenCOTSServer) (char *address)
{
- PRMSG (2,"OpenCOTSServer(%s)\n", address, 0, 0);
+ prmsg (2,"OpenCOTSServer(%s)\n", address);
return TRANS(Open) (XTRANS_OPEN_COTS_SERVER, address);
}
@@ -583,7 +583,7 @@ XtransConnInfo
TRANS(OpenCLTSClient) (char *address)
{
- PRMSG (2,"OpenCLTSClient(%s)\n", address, 0, 0);
+ prmsg (2,"OpenCLTSClient(%s)\n", address);
return TRANS(Open) (XTRANS_OPEN_CLTS_CLIENT, address);
}
@@ -596,7 +596,7 @@ XtransConnInfo
TRANS(OpenCLTSServer) (char *address)
{
- PRMSG (2,"OpenCLTSServer(%s)\n", address, 0, 0);
+ prmsg (2,"OpenCLTSServer(%s)\n", address);
return TRANS(Open) (XTRANS_OPEN_CLTS_SERVER, address);
}
@@ -609,7 +609,7 @@ XtransConnInfo
TRANS(ReopenCOTSServer) (int trans_id, int fd, char *port)
{
- PRMSG (2,"ReopenCOTSServer(%d, %d, %s)\n", trans_id, fd, port);
+ prmsg (2,"ReopenCOTSServer(%d, %d, %s)\n", trans_id, fd, port);
return TRANS(Reopen) (XTRANS_OPEN_COTS_SERVER, trans_id, fd, port);
}
@@ -617,7 +617,7 @@ XtransConnInfo
TRANS(ReopenCLTSServer) (int trans_id, int fd, char *port)
{
- PRMSG (2,"ReopenCLTSServer(%d, %d, %s)\n", trans_id, fd, port);
+ prmsg (2,"ReopenCLTSServer(%d, %d, %s)\n", trans_id, fd, port);
return TRANS(Reopen) (XTRANS_OPEN_CLTS_SERVER, trans_id, fd, port);
}
@@ -657,7 +657,7 @@ TRANS(SetOption) (XtransConnInfo ciptr, int option, int arg)
int fd = ciptr->fd;
int ret = 0;
- PRMSG (2,"SetOption(%d,%d,%d)\n", fd, option, arg);
+ prmsg (2,"SetOption(%d,%d,%d)\n", fd, option, arg);
/*
* For now, all transport type use the same stuff for setting options.
@@ -751,8 +751,8 @@ TRANS(NoListen) (char * protocol)
if ((trans = TRANS(SelectTransport)(protocol)) == NULL)
{
- PRMSG (1,"TransNoListen: unable to find transport: %s\n",
- protocol, 0, 0);
+ prmsg (1,"TransNoListen: unable to find transport: %s\n",
+ protocol);
return -1;
}
@@ -785,7 +785,7 @@ TRANS(Accept) (XtransConnInfo ciptr, int *status)
{
XtransConnInfo newciptr;
- PRMSG (2,"Accept(%d)\n", ciptr->fd, 0, 0);
+ prmsg (2,"Accept(%d)\n", ciptr->fd);
newciptr = ciptr->transptr->Accept (ciptr, status);
@@ -809,19 +809,19 @@ TRANS(Connect) (XtransConnInfo ciptr, char *address)
char *port;
int ret;
- PRMSG (2,"Connect(%d,%s)\n", ciptr->fd, address, 0);
+ prmsg (2,"Connect(%d,%s)\n", ciptr->fd, address);
if (TRANS(ParseAddress) (address, &protocol, &host, &port) == 0)
{
- PRMSG (1,"Connect: Unable to Parse address %s\n",
- address, 0, 0);
+ prmsg (1,"Connect: Unable to Parse address %s\n",
+ address);
return -1;
}
if (!port || !*port)
{
- PRMSG (1,"Connect: Missing port specification in %s\n",
- address, 0, 0);
+ prmsg (1,"Connect: Missing port specification in %s\n",
+ address);
if (protocol) free (protocol);
if (host) free (host);
return -1;
@@ -887,7 +887,7 @@ TRANS(Close) (XtransConnInfo ciptr)
{
int ret;
- PRMSG (2,"Close(%d)\n", ciptr->fd, 0, 0);
+ prmsg (2,"Close(%d)\n", ciptr->fd);
ret = ciptr->transptr->Close (ciptr);
@@ -902,7 +902,7 @@ TRANS(CloseForCloning) (XtransConnInfo ciptr)
{
int ret;
- PRMSG (2,"CloseForCloning(%d)\n", ciptr->fd, 0, 0);
+ prmsg (2,"CloseForCloning(%d)\n", ciptr->fd);
ret = ciptr->transptr->CloseForCloning (ciptr);
@@ -924,14 +924,14 @@ TRANS(GetMyAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp,
Xtransaddr **addrp)
{
- PRMSG (2,"GetMyAddr(%d)\n", ciptr->fd, 0, 0);
+ prmsg (2,"GetMyAddr(%d)\n", ciptr->fd);
*familyp = ciptr->family;
*addrlenp = ciptr->addrlen;
if ((*addrp = (Xtransaddr *) malloc (ciptr->addrlen)) == NULL)
{
- PRMSG (1,"GetMyAddr: malloc failed\n", 0, 0, 0);
+ prmsg (1,"GetMyAddr: malloc failed\n");
return -1;
}
memcpy(*addrp, ciptr->addr, ciptr->addrlen);
@@ -944,14 +944,14 @@ TRANS(GetPeerAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp,
Xtransaddr **addrp)
{
- PRMSG (2,"GetPeerAddr(%d)\n", ciptr->fd, 0, 0);
+ prmsg (2,"GetPeerAddr(%d)\n", ciptr->fd);
*familyp = ciptr->family;
*addrlenp = ciptr->peeraddrlen;
if ((*addrp = (Xtransaddr *) malloc (ciptr->peeraddrlen)) == NULL)
{
- PRMSG (1,"GetPeerAddr: malloc failed\n", 0, 0, 0);
+ prmsg (1,"GetPeerAddr: malloc failed\n");
return -1;
}
memcpy(*addrp, ciptr->peeraddr, ciptr->peeraddrlen);
@@ -1017,8 +1017,8 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
int ipv6_succ = 0;
#endif
- PRMSG (2,"MakeAllCOTSServerListeners(%s,%p)\n",
- port ? port : "NULL", ciptrs_ret, 0);
+ prmsg (2,"MakeAllCOTSServerListeners(%s,%p)\n",
+ port ? port : "NULL", ciptrs_ret);
*count_ret = 0;
@@ -1032,17 +1032,17 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
sprintf(buffer,"%s/:%s", trans->TransName, port ? port : "");
- PRMSG (5,"MakeAllCOTSServerListeners: opening %s\n",
- buffer, 0, 0);
+ prmsg (5,"MakeAllCOTSServerListeners: opening %s\n",
+ buffer);
if ((ciptr = TRANS(OpenCOTSServer(buffer))) == NULL)
{
if (trans->flags & TRANS_DISABLED)
continue;
- PRMSG (1,
+ prmsg (1,
"MakeAllCOTSServerListeners: failed to open listener for %s\n",
- trans->TransName, 0, 0);
+ trans->TransName);
continue;
}
#if defined(IPv6) && defined(AF_INET6)
@@ -1061,9 +1061,8 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
* running at this address, and this function should fail.
*/
- PRMSG (1,
- "MakeAllCOTSServerListeners: server already running\n",
- 0, 0, 0);
+ prmsg (1,
+ "MakeAllCOTSServerListeners: server already running\n");
for (j = 0; j < *count_ret; j++)
TRANS(Close) (temp_ciptrs[j]);
@@ -1075,9 +1074,9 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
}
else
{
- PRMSG (1,
+ prmsg (1,
"MakeAllCOTSServerListeners: failed to create listener for %s\n",
- trans->TransName, 0, 0);
+ trans->TransName);
continue;
}
@@ -1088,9 +1087,9 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
ipv6_succ = 1;
#endif
- PRMSG (5,
+ prmsg (5,
"MakeAllCOTSServerListeners: opened listener for %s, %d\n",
- trans->TransName, ciptr->fd, 0);
+ trans->TransName, ciptr->fd);
temp_ciptrs[*count_ret] = ciptr;
(*count_ret)++;
@@ -1098,7 +1097,7 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
*partial = (*count_ret < complete_network_count());
- PRMSG (5,
+ prmsg (5,
"MakeAllCOTSServerListeners: partial=%d, actual=%d, complete=%d \n",
*partial, *count_ret, complete_network_count());
@@ -1130,8 +1129,8 @@ TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
XtransConnInfo ciptr, temp_ciptrs[NUMTRANS];
int status, i, j;
- PRMSG (2,"MakeAllCLTSServerListeners(%s,%p)\n",
- port ? port : "NULL", ciptrs_ret, 0);
+ prmsg (2,"MakeAllCLTSServerListeners(%s,%p)\n",
+ port ? port : "NULL", ciptrs_ret);
*count_ret = 0;
@@ -1144,14 +1143,14 @@ TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
sprintf(buffer,"%s/:%s", trans->TransName, port ? port : "");
- PRMSG (5,"MakeAllCLTSServerListeners: opening %s\n",
- buffer, 0, 0);
+ prmsg (5,"MakeAllCLTSServerListeners: opening %s\n",
+ buffer);
if ((ciptr = TRANS(OpenCLTSServer (buffer))) == NULL)
{
- PRMSG (1,
+ prmsg (1,
"MakeAllCLTSServerListeners: failed to open listener for %s\n",
- trans->TransName, 0, 0);
+ trans->TransName);
continue;
}
@@ -1165,9 +1164,8 @@ TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
* running at this address, and this function should fail.
*/
- PRMSG (1,
- "MakeAllCLTSServerListeners: server already running\n",
- 0, 0, 0);
+ prmsg (1,
+ "MakeAllCLTSServerListeners: server already running\n");
for (j = 0; j < *count_ret; j++)
TRANS(Close) (temp_ciptrs[j]);
@@ -1179,24 +1177,24 @@ TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
}
else
{
- PRMSG (1,
+ prmsg (1,
"MakeAllCLTSServerListeners: failed to create listener for %s\n",
- trans->TransName, 0, 0);
+ trans->TransName);
continue;
}
}
- PRMSG (5,
+ prmsg (5,
"MakeAllCLTSServerListeners: opened listener for %s, %d\n",
- trans->TransName, ciptr->fd, 0);
+ trans->TransName, ciptr->fd);
temp_ciptrs[*count_ret] = ciptr;
(*count_ret)++;
}
*partial = (*count_ret < complete_network_count());
- PRMSG (5,
+ prmsg (5,
"MakeAllCLTSServerListeners: partial=%d, actual=%d, complete=%d \n",
*partial, *count_ret, complete_network_count());
diff --git a/nx-X11/lib/xtrans/Xtransint.h b/nx-X11/lib/xtrans/Xtransint.h
index b7ca80541..0da59f71d 100644
--- a/nx-X11/lib/xtrans/Xtransint.h
+++ b/nx-X11/lib/xtrans/Xtransint.h
@@ -306,6 +306,9 @@ typedef struct _Xtransport_table {
/* Flags to preserve when setting others */
#define TRANS_KEEPFLAGS (TRANS_NOUNLINK|TRANS_ABSTRACT)
+#ifdef XTRANS_TRANSPORT_C /* only provide static function prototypes when
+ building the transport.c file that has them in */
+
/*
* readv() and writev() don't exist or don't work correctly on some
* systems, so they may be emulated.
@@ -360,54 +363,62 @@ static int trans_mkdir (
* Some XTRANSDEBUG stuff
*/
-#if defined(XTRANSDEBUG)
-/* add hack to the format string to avoid warnings about extra arguments
- * to fprintf.
+#ifdef XTRANSDEBUG
+#include <stdarg.h>
+
+/*
+ * The X server provides ErrorF() & VErrorF(), for other software that uses
+ * xtrans, we provide our own simple versions.
*/
-#ifdef XTRANSDEBUGTIMESTAMP
-#if defined(XSERV_t) && defined(TRANS_SERVER)
-/* Use ErrorF() for the X server */
-#define PRMSG(lvl,x,a,b,c) if (lvl <= XTRANSDEBUG){ \
- int hack= 0, saveerrno=errno; \
- struct timeval tp;\
- gettimeofday(&tp,0); \
- ErrorF("%s",__xtransname); \
- ErrorF(x+hack,a,b,c); \
- ErrorF("timestamp (ms): %d\n",tp.tv_sec*1000+tp.tv_usec/1000); \
- errno=saveerrno; \
- } else ((void)0)
-#else
-#define PRMSG(lvl,x,a,b,c) if (lvl <= XTRANSDEBUG){ \
- int hack= 0, saveerrno=errno; \
- struct timeval tp;\
- gettimeofday(&tp,0); \
- fprintf(stderr, "%s",__xtransname); fflush(stderr); \
- fprintf(stderr, x+hack,a,b,c); fflush(stderr); \
- fprintf(stderr, "timestamp (ms): %d\n",tp.tv_sec*1000+tp.tv_usec/1000); \
- fflush(stderr); \
- errno=saveerrno; \
- } else ((void)0)
-#endif /* XSERV_t && TRANS_SERVER */
-#else /* XTRANSDEBUGTIMESTAMP */
-#if defined(XSERV_t) && defined(TRANS_SERVER)
-/* Use ErrorF() for the X server */
-#define PRMSG(lvl,x,a,b,c) if (lvl <= XTRANSDEBUG){ \
- int hack= 0, saveerrno=errno; \
- ErrorF("%s",__xtransname); \
- ErrorF(x+hack,a,b,c); \
- errno=saveerrno; \
- } else ((void)0)
-#else
-#define PRMSG(lvl,x,a,b,c) if (lvl <= XTRANSDEBUG){ \
- int hack= 0, saveerrno=errno; \
- fprintf(stderr, "%s",__xtransname); fflush(stderr); \
- fprintf(stderr, x+hack,a,b,c); fflush(stderr); \
- errno=saveerrno; \
- } else ((void)0)
-#endif /* XSERV_t && TRANS_SERVER */
-#endif /* XTRANSDEBUGTIMESTAMP */
-#else
-#define PRMSG(lvl,x,a,b,c) ((void)0)
+# if defined(XSERV_t) && defined(TRANS_SERVER)
+# include "os.h"
+# else
+static inline void _X_ATTRIBUTE_PRINTF(1, 0)
+VErrorF(const char *f, va_list args)
+{
+ vfprintf(stderr, f, args);
+ fflush(stderr);
+}
+
+static inline void _X_ATTRIBUTE_PRINTF(1, 2)
+ErrorF(const char *f, ...)
+{
+ va_list args;
+
+ va_start(args, f);
+ VErrorF(f, args);
+ va_end(args);
+}
+# endif /* xserver */
+#endif /* XTRANSDEBUG */
+
+static inline void _X_ATTRIBUTE_PRINTF(2, 3)
+prmsg(int lvl, const char *f, ...)
+{
+#ifdef XTRANSDEBUG
+ va_list args;
+
+ va_start(args, f);
+ if (lvl <= XTRANSDEBUG) {
+ int saveerrno = errno;
+
+ ErrorF("%s", __xtransname);
+ VErrorF(f, args);
+
+# ifdef XTRANSDEBUGTIMESTAMP
+ {
+ struct timeval tp;
+ gettimeofday(&tp, 0);
+ ErrorF("timestamp (ms): %d\n",
+ tp.tv_sec * 1000 + tp.tv_usec / 1000);
+ }
+# endif
+ errno = saveerrno;
+ }
+ va_end(args);
#endif /* XTRANSDEBUG */
+}
+
+#endif /* XTRANS_TRANSPORT_C */
#endif /* _XTRANSINT_H_ */
diff --git a/nx-X11/lib/xtrans/Xtranslcl.c b/nx-X11/lib/xtrans/Xtranslcl.c
index 7f726f3e7..74a5c5673 100644
--- a/nx-X11/lib/xtrans/Xtranslcl.c
+++ b/nx-X11/lib/xtrans/Xtranslcl.c
@@ -142,14 +142,14 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path)
if ((sunaddr = (struct sockaddr_un *) malloc (ciptr->addrlen)) == NULL)
{
- PRMSG(1,"FillAddrInfo: failed to allocate memory for addr\n", 0, 0, 0);
+ prmsg(1,"FillAddrInfo: failed to allocate memory for addr\n");
return 0;
}
sunaddr->sun_family = AF_UNIX;
if (strlen(sun_path) > sizeof(sunaddr->sun_path) - 1) {
- PRMSG(1, "FillAddrInfo: path too long\n", 0, 0, 0);
+ prmsg(1, "FillAddrInfo: path too long\n");
return 0;
}
strcpy (sunaddr->sun_path, sun_path);
@@ -164,9 +164,8 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path)
if ((p_sunaddr = (struct sockaddr_un *) malloc (
ciptr->peeraddrlen)) == NULL)
{
- PRMSG(1,
- "FillAddrInfo: failed to allocate memory for peer addr\n",
- 0,0,0);
+ prmsg(1,
+ "FillAddrInfo: failed to allocate memory for peer addr\n");
free ((char *) sunaddr);
ciptr->addr = NULL;
@@ -176,7 +175,7 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path)
p_sunaddr->sun_family = AF_UNIX;
if (strlen(peer_sun_path) > sizeof(p_sunaddr->sun_path) - 1) {
- PRMSG(1, "FillAddrInfo: peer path too long\n", 0, 0, 0);
+ prmsg(1, "FillAddrInfo: peer path too long\n");
return 0;
}
strcpy (p_sunaddr->sun_path, peer_sun_path);
@@ -296,10 +295,10 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
pid_t saved_pid;
#endif
- PRMSG(2,"PTSOpenClient(%s)\n", port, 0,0 );
+ prmsg(2,"PTSOpenClient(%s)\n", port);
#if !defined(PTSNODENAME)
- PRMSG(1,"PTSOpenClient: Protocol is not supported by a pts connection\n", 0,0,0);
+ prmsg(1,"PTSOpenClient: Protocol is not supported by a pts connection\n");
return -1;
#else
if (port && *port ) {
@@ -318,7 +317,7 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
*/
if ((server = open (server_path, O_RDWR)) < 0) {
- PRMSG(1,"PTSOpenClient: failed to open %s\n", server_path, 0,0);
+ prmsg(1,"PTSOpenClient: failed to open %s\n", server_path);
return -1;
}
@@ -328,7 +327,7 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
*/
if ((fd = open(DEV_PTMX, O_RDWR)) < 0) {
- PRMSG(1,"PTSOpenClient: failed to open %s\n", DEV_PTMX, 0,0);
+ prmsg(1,"PTSOpenClient: failed to open %s\n", DEV_PTMX);
return(-1);
}
@@ -338,7 +337,7 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
slave = ptsname(fd); /* get name */
if( slave == NULL ) {
- PRMSG(1,"PTSOpenClient: failed to get ptsname()\n", 0,0,0);
+ prmsg(1,"PTSOpenClient: failed to get ptsname()\n");
close(fd);
close(server);
return -1;
@@ -371,14 +370,14 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
if (WIFEXITED(exitval) && WEXITSTATUS(exitval) != 0) {
close(fd);
close(server);
- PRMSG(1, "PTSOpenClient: cannot set the owner of %s\n",
- slave, 0, 0);
+ prmsg(1, "PTSOpenClient: cannot set the owner of %s\n",
+ slave);
return(-1);
}
if (chmod(slave, 0666) < 0) {
close(fd);
close(server);
- PRMSG(1,"PTSOpenClient: Cannot chmod %s\n", slave, 0,0);
+ prmsg(1,"PTSOpenClient: Cannot chmod %s\n", slave);
return(-1);
}
@@ -405,8 +404,8 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
(void) signal(SIGALRM, savef);
if (ret != 1) {
- PRMSG(1,
- "PTSOpenClient: failed to get acknoledgement from server\n", 0, 0, 0);
+ prmsg(1,
+ "PTSOpenClient: failed to get acknoledgement from server\n");
(void) close(fd);
fd = -1;
}
@@ -417,7 +416,7 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port)
if (TRANS(FillAddrInfo) (ciptr, slave, server_path) == 0)
{
- PRMSG(1,"PTSOpenClient: failed to fill in addr info\n", 0, 0, 0);
+ prmsg(1,"PTSOpenClient: failed to fill in addr info\n");
close(fd);
return -1;
}
@@ -442,10 +441,10 @@ TRANS(PTSOpenServer)(XtransConnInfo ciptr, char *port)
int mode;
#endif
- PRMSG(2,"PTSOpenServer(%s)\n", port, 0,0 );
+ prmsg(2,"PTSOpenServer(%s)\n", port);
#if !defined(PTSNODENAME)
- PRMSG(1,"PTSOpenServer: Protocol is not supported by a pts connection\n", 0,0,0);
+ prmsg(1,"PTSOpenServer: Protocol is not supported by a pts connection\n");
return -1;
#else
if (port && *port ) {
@@ -464,8 +463,8 @@ TRANS(PTSOpenServer)(XtransConnInfo ciptr, char *port)
mode = 0777;
#endif
if (trans_mkdir(X_STREAMS_DIR, mode) == -1) {
- PRMSG (1, "PTSOpenServer: mkdir(%s) failed, errno = %d\n",
- X_STREAMS_DIR, errno, 0);
+ prmsg (1, "PTSOpenServer: mkdir(%s) failed, errno = %d\n",
+ X_STREAMS_DIR, errno);
return(-1);
}
@@ -476,8 +475,8 @@ TRANS(PTSOpenServer)(XtransConnInfo ciptr, char *port)
* prevent clients from trying to connect to the in-use PTS (which
* is often in use by something other than another server).
*/
- PRMSG(1, "PTSOpenServer: A server is already running on port %s\n", port, 0,0 );
- PRMSG(1, "PTSOpenServer: Remove %s if this is incorrect.\n", server_path, 0,0 );
+ prmsg(1, "PTSOpenServer: A server is already running on port %s\n", port);
+ prmsg(1, "PTSOpenServer: Remove %s if this is incorrect.\n", server_path);
close(fd);
return(-1);
}
@@ -488,7 +487,7 @@ TRANS(PTSOpenServer)(XtransConnInfo ciptr, char *port)
unlink(server_path);
if( (fd=open(DEV_PTMX, O_RDWR)) < 0) {
- PRMSG(1, "PTSOpenServer: Unable to open %s\n", DEV_PTMX, 0,0 );
+ prmsg(1, "PTSOpenServer: Unable to open %s\n", DEV_PTMX);
return(-1);
}
@@ -496,25 +495,25 @@ TRANS(PTSOpenServer)(XtransConnInfo ciptr, char *port)
unlockpt(fd);
if( (slave=ptsname(fd)) == NULL) {
- PRMSG(1, "PTSOpenServer: Unable to get slave device name\n", 0,0,0 );
+ prmsg(1, "PTSOpenServer: Unable to get slave device name\n");
close(fd);
return(-1);
}
if( link(slave,server_path) < 0 ) {
- PRMSG(1, "PTSOpenServer: Unable to link %s to %s\n", slave, server_path,0 );
+ prmsg(1, "PTSOpenServer: Unable to link %s to %s\n", slave, server_path);
close(fd);
return(-1);
}
if( chmod(server_path, 0666) < 0 ) {
- PRMSG(1, "PTSOpenServer: Unable to chmod %s to 0666\n", server_path,0,0 );
+ prmsg(1, "PTSOpenServer: Unable to chmod %s to 0666\n", server_path);
close(fd);
return(-1);
}
if( (server=open(server_path, O_RDWR)) < 0 ) {
- PRMSG(1, "PTSOpenServer: Unable to open server device %s\n", server_path,0,0 );
+ prmsg(1, "PTSOpenServer: Unable to open server device %s\n", server_path);
close(fd);
return(-1);
}
@@ -527,7 +526,7 @@ TRANS(PTSOpenServer)(XtransConnInfo ciptr, char *port)
if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0)
{
- PRMSG(1,"PTSOpenServer: failed to fill in addr info\n", 0, 0, 0);
+ prmsg(1,"PTSOpenServer: failed to fill in addr info\n");
close(fd);
return -1;
}
@@ -547,17 +546,17 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
char buf[256];
struct sockaddr_un *sunaddr;
- PRMSG(2,"PTSAccept(%x->%d)\n",ciptr,ciptr->fd,0);
+ prmsg(2,"PTSAccept(%x->%d)\n",ciptr,ciptr->fd);
if( (in=read(ciptr->fd,&length,1)) <= 0 ){
if( !in ) {
- PRMSG(2,
- "PTSAccept: Incoming connection closed\n",0,0,0);
+ prmsg(2,
+ "PTSAccept: Incoming connection closed\n");
}
else {
- PRMSG(1,
+ prmsg(1,
"PTSAccept: Error reading incoming connection. errno=%d \n",
- errno,0,0);
+ errno);
}
*status = TRANS_ACCEPT_MISC_ERROR;
return -1;
@@ -565,13 +564,13 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
if( (in=read(ciptr->fd,buf,length)) <= 0 ){
if( !in ) {
- PRMSG(2,
- "PTSAccept: Incoming connection closed\n",0,0,0);
+ prmsg(2,
+ "PTSAccept: Incoming connection closed\n");
}
else {
- PRMSG(1,
+ prmsg(1,
"PTSAccept: Error reading device name for new connection. errno=%d \n",
- errno,0,0);
+ errno);
}
*status = TRANS_ACCEPT_MISC_ERROR;
return -1;
@@ -580,7 +579,7 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
buf[length] = '\0';
if( (newfd=open(buf,O_RDWR)) < 0 ) {
- PRMSG(1, "PTSAccept: Failed to open %s\n",buf,0,0);
+ prmsg(1, "PTSAccept: Failed to open %s\n",buf);
*status = TRANS_ACCEPT_MISC_ERROR;
return -1;
}
@@ -593,8 +592,7 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
newciptr->addrlen=ciptr->addrlen;
if( (newciptr->addr=(char *)malloc(newciptr->addrlen)) == NULL ) {
- PRMSG(1,"PTSAccept: failed to allocate memory for peer addr\n",
- 0,0,0);
+ prmsg(1,"PTSAccept: failed to allocate memory for peer addr\n");
close(newfd);
*status = TRANS_ACCEPT_BAD_MALLOC;
return -1;
@@ -604,8 +602,7 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
newciptr->peeraddrlen=sizeof(struct sockaddr_un);
if( (sunaddr=(struct sockaddr_un *)malloc(newciptr->peeraddrlen)) == NULL ) {
- PRMSG(1,"PTSAccept: failed to allocate memory for peer addr\n",
- 0,0,0);
+ prmsg(1,"PTSAccept: failed to allocate memory for peer addr\n");
free(newciptr->addr);
close(newfd);
*status = TRANS_ACCEPT_BAD_MALLOC;
@@ -646,10 +643,10 @@ TRANS(NAMEDOpenClient)(XtransConnInfo ciptr, char *port)
extern int isastream();
#endif
- PRMSG(2,"NAMEDOpenClient(%s)\n", port, 0,0 );
+ prmsg(2,"NAMEDOpenClient(%s)\n", port);
#if !defined(NAMEDNODENAME)
- PRMSG(1,"NAMEDOpenClient: Protocol is not supported by a NAMED connection\n", 0,0,0);
+ prmsg(1,"NAMEDOpenClient: Protocol is not supported by a NAMED connection\n");
return -1;
#else
if ( port && *port ) {
@@ -663,23 +660,23 @@ TRANS(NAMEDOpenClient)(XtransConnInfo ciptr, char *port)
}
if (stat(server_path, &filestat) < 0 ) {
- PRMSG(1,"NAMEDOpenClient: No device %s for NAMED connection\n", server_path, 0,0 );
+ prmsg(1,"NAMEDOpenClient: No device %s for NAMED connection\n", server_path);
return -1;
}
if ((filestat.st_mode & S_IFMT) != S_IFIFO) {
- PRMSG(1,"NAMEDOpenClient: Device %s is not a FIFO\n", server_path, 0,0 );
+ prmsg(1,"NAMEDOpenClient: Device %s is not a FIFO\n", server_path);
/* Is this really a failure? */
return -1;
}
if ((fd = open(server_path, O_RDWR)) < 0) {
- PRMSG(1,"NAMEDOpenClient: Cannot open %s for NAMED connection\n", server_path, 0,0 );
+ prmsg(1,"NAMEDOpenClient: Cannot open %s for NAMED connection\n", server_path);
return -1;
}
if (isastream(fd) <= 0) {
- PRMSG(1,"NAMEDOpenClient: %s is not a streams device\n", server_path, 0,0 );
+ prmsg(1,"NAMEDOpenClient: %s is not a streams device\n", server_path);
(void) close(fd);
return -1;
}
@@ -690,8 +687,7 @@ TRANS(NAMEDOpenClient)(XtransConnInfo ciptr, char *port)
if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0)
{
- PRMSG(1,"NAMEDOpenClient: failed to fill in addr info\n",
- 0,0,0);
+ prmsg(1,"NAMEDOpenClient: failed to fill in addr info\n");
close(fd);
return -1;
}
@@ -717,10 +713,10 @@ TRANS(NAMEDOpenServer)(XtransConnInfo ciptr, char *port)
int mode;
#endif
- PRMSG(2,"NAMEDOpenServer(%s)\n", port, 0,0 );
+ prmsg(2,"NAMEDOpenServer(%s)\n", port);
#if !defined(NAMEDNODENAME)
- PRMSG(1,"NAMEDOpenServer: Protocol is not supported by a NAMED connection\n", 0,0,0);
+ prmsg(1,"NAMEDOpenServer: Protocol is not supported by a NAMED connection\n");
return -1;
#else
if ( port && *port ) {
@@ -739,42 +735,42 @@ TRANS(NAMEDOpenServer)(XtransConnInfo ciptr, char *port)
mode = 0777;
#endif
if (trans_mkdir(X_STREAMS_DIR, mode) == -1) {
- PRMSG (1, "NAMEDOpenServer: mkdir(%s) failed, errno = %d\n",
- X_STREAMS_DIR, errno, 0);
+ prmsg (1, "NAMEDOpenServer: mkdir(%s) failed, errno = %d\n",
+ X_STREAMS_DIR, errno);
return(-1);
}
if(stat(server_path, &sbuf) != 0) {
if (errno == ENOENT) {
if ((fd = creat(server_path, (mode_t)0666)) == -1) {
- PRMSG(1, "NAMEDOpenServer: Can't open %s\n", server_path, 0,0 );
+ prmsg(1, "NAMEDOpenServer: Can't open %s\n", server_path);
return(-1);
}
close(fd);
if (chmod(server_path, (mode_t)0666) < 0) {
- PRMSG(1, "NAMEDOpenServer: Can't open %s\n", server_path, 0,0 );
+ prmsg(1, "NAMEDOpenServer: Can't open %s\n", server_path);
return(-1);
}
} else {
- PRMSG(1, "NAMEDOpenServer: stat on %s failed\n", server_path, 0,0 );
+ prmsg(1, "NAMEDOpenServer: stat on %s failed\n", server_path);
return(-1);
}
}
if( pipe(pipefd) != 0) {
- PRMSG(1, "NAMEDOpenServer: pipe() failed, errno=%d\n",errno, 0,0 );
+ prmsg(1, "NAMEDOpenServer: pipe() failed, errno=%d\n",errno);
return(-1);
}
if( ioctl(pipefd[0], I_PUSH, "connld") != 0) {
- PRMSG(1, "NAMEDOpenServer: ioctl(I_PUSH,\"connld\") failed, errno=%d\n",errno, 0,0 );
+ prmsg(1, "NAMEDOpenServer: ioctl(I_PUSH,\"connld\") failed, errno=%d\n",errno);
close(pipefd[0]);
close(pipefd[1]);
return(-1);
}
if( fattach(pipefd[0], server_path) != 0) {
- PRMSG(1, "NAMEDOpenServer: fattach(%s) failed, errno=%d\n", server_path,errno, 0 );
+ prmsg(1, "NAMEDOpenServer: fattach(%s) failed, errno=%d\n", server_path,errno);
close(pipefd[0]);
close(pipefd[1]);
return(-1);
@@ -786,7 +782,7 @@ TRANS(NAMEDOpenServer)(XtransConnInfo ciptr, char *port)
if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0)
{
- PRMSG(1,"NAMEDOpenServer: failed to fill in addr info\n", 0,0,0);
+ prmsg(1,"NAMEDOpenServer: failed to fill in addr info\n");
return -1;
}
@@ -801,10 +797,10 @@ TRANS(NAMEDAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
{
struct strrecvfd str;
- PRMSG(2,"NAMEDAccept(%x->%d)\n", ciptr, ciptr->fd, 0 );
+ prmsg(2,"NAMEDAccept(%x->%d)\n", ciptr, ciptr->fd);
if( ioctl(ciptr->fd, I_RECVFD, &str ) < 0 ) {
- PRMSG(1, "NAMEDAccept: ioctl(I_RECVFD) failed, errno=%d\n", errno, 0,0 );
+ prmsg(1, "NAMEDAccept: ioctl(I_RECVFD) failed, errno=%d\n", errno);
*status = TRANS_ACCEPT_MISC_ERROR;
return(-1);
}
@@ -815,9 +811,8 @@ TRANS(NAMEDAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
newciptr->addrlen=ciptr->addrlen;
if( (newciptr->addr=(char *)malloc(newciptr->addrlen)) == NULL ) {
- PRMSG(1,
- "NAMEDAccept: failed to allocate memory for peer addr\n",
- 0,0,0);
+ prmsg(1,
+ "NAMEDAccept: failed to allocate memory for peer addr\n");
close(str.fd);
*status = TRANS_ACCEPT_BAD_MALLOC;
return -1;
@@ -827,9 +822,8 @@ TRANS(NAMEDAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
newciptr->peeraddrlen=newciptr->addrlen;
if( (newciptr->peeraddr=(char *)malloc(newciptr->peeraddrlen)) == NULL ) {
- PRMSG(1,
- "NAMEDAccept: failed to allocate memory for peer addr\n",
- 0,0,0);
+ prmsg(1,
+ "NAMEDAccept: failed to allocate memory for peer addr\n");
free(newciptr->addr);
close(str.fd);
*status = TRANS_ACCEPT_BAD_MALLOC;
@@ -925,10 +919,10 @@ TRANS(ISCOpenClient)(XtransConnInfo ciptr, char *port)
struct stat filestat;
#endif
- PRMSG(2,"ISCOpenClient(%s)\n", port, 0,0 );
+ prmsg(2,"ISCOpenClient(%s)\n", port);
#if !defined(ISCDEVNODENAME)
- PRMSG(1,"ISCOpenClient: Protocol is not supported by a ISC connection\n", 0,0,0);
+ prmsg(1,"ISCOpenClient: Protocol is not supported by a ISC connection\n");
return -1;
#else
(void) sprintf(server_path, ISCTMPNODENAME, port);
@@ -937,7 +931,7 @@ TRANS(ISCOpenClient)(XtransConnInfo ciptr, char *port)
fd = fds = server = -1;
if (stat(DEV_SPX, &filestat) == -1) {
- PRMSG(1, "ISCOpenClient: stat(%s) failed, errno=%d\n", DEV_SPX, errno, 0 );
+ prmsg(1, "ISCOpenClient: stat(%s) failed, errno=%d\n", DEV_SPX, errno);
return(-1);
}
@@ -946,8 +940,8 @@ TRANS(ISCOpenClient)(XtransConnInfo ciptr, char *port)
if (stat(server_path, &filestat) != -1) {
if ((filestat.st_mode & S_IFMT) == spmode) {
if ((server = open(server_path, O_RDWR)) < 0) {
- PRMSG(1,"ISCOpenClient: failed to open %s\n",
- server_path, 0,0 );
+ prmsg(1,"ISCOpenClient: failed to open %s\n",
+ server_path);
}
}
}
@@ -957,23 +951,23 @@ TRANS(ISCOpenClient)(XtransConnInfo ciptr, char *port)
if (stat(server_dev_path, &filestat) != -1) {
if ((filestat.st_mode & S_IFMT) == spmode) {
if ((server = open(server_dev_path, O_RDWR)) < 0) {
- PRMSG(1,"ISCOpenClient: failed to open %s\n",
- server_dev_path, 0,0 );
+ prmsg(1,"ISCOpenClient: failed to open %s\n",
+ server_dev_path);
}
}
}
}
if (server < 0) {
- PRMSG(1,"ISCOpenClient: can't open either device %s or %s\n",
- server_path, server_dev_path, 0 );
+ prmsg(1,"ISCOpenClient: can't open either device %s or %s\n",
+ server_path, server_dev_path);
return -1;
}
if ((fds = open(DEV_SPX, O_RDWR)) < 0 ||
(fd = open(DEV_SPX, O_RDWR)) < 0) {
/* Failed to open all of the devices */
- PRMSG(1,"ISCOpenClient: can't open %s\n", DEV_SPX, 0,0 );
+ prmsg(1,"ISCOpenClient: can't open %s\n", DEV_SPX);
(void) close(server);
if (fds != -1)
(void) close(fds);
@@ -996,8 +990,7 @@ TRANS(ISCOpenClient)(XtransConnInfo ciptr, char *port)
if (ioctl(fds, I_FDINSERT, &buf) < 0 ||
ioctl(server, I_SENDFD, fds) < 0) {
- PRMSG(1,"ISCOpenClient: ioctl(I_FDINSERT or I_SENDFD) failed\n",
- 0,0,0 );
+ prmsg(1,"ISCOpenClient: ioctl(I_FDINSERT or I_SENDFD) failed\n");
(void) close(server);
(void) close(fds);
(void) close(fd);
@@ -1010,7 +1003,7 @@ TRANS(ISCOpenClient)(XtransConnInfo ciptr, char *port)
if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0)
{
- PRMSG(1,"ISCOpenClient: failed to fill in addr info\n", 0, 0, 0);
+ prmsg(1,"ISCOpenClient: failed to fill in addr info\n");
close(fd);
return -1;
}
@@ -1035,10 +1028,10 @@ TRANS(ISCOpenServer)(XtransConnInfo ciptr, char *port)
unsigned int mode = 0;
#endif
- PRMSG(2,"ISCOpenServer(%s)\n", port, 0,0 );
+ prmsg(2,"ISCOpenServer(%s)\n", port);
#if !defined(ISCDEVNODENAME)
- PRMSG(1,"ISCOpenServer: Protocol is not supported by a ISC connection\n", 0,0,0);
+ prmsg(1,"ISCOpenServer: Protocol is not supported by a ISC connection\n");
return -1;
#else
(void) sprintf(server_path, ISCDEVNODENAME, port);
@@ -1052,14 +1045,14 @@ TRANS(ISCOpenServer)(XtransConnInfo ciptr, char *port)
/* "/dev/X" */
if (trans_mkdir(X_STREAMS_DIR, mode) == -1) {
- PRMSG (1, "ISCOpenServer: mkdir(%s) failed, errno = %d\n",
- X_STREAMS_DIR, errno, 0);
+ prmsg (1, "ISCOpenServer: mkdir(%s) failed, errno = %d\n",
+ X_STREAMS_DIR, errno);
return(-1);
}
/* "/dev/X/ISCCONN" */
if (trans_mkdir(X_ISC_DIR, mode) == -1) {
- PRMSG (1, "ISCOpenServer: mkdir(%s) failed, errno = %d\n",
- X_ISC_DIR, errno, 0);
+ prmsg (1, "ISCOpenServer: mkdir(%s) failed, errno = %d\n",
+ X_ISC_DIR, errno);
return(-1);
}
@@ -1067,13 +1060,13 @@ TRANS(ISCOpenServer)(XtransConnInfo ciptr, char *port)
if( ((fds=open(DEV_SPX, O_RDWR)) < 0) ||
((fd =open(DEV_SPX, O_RDWR)) < 0)) {
- PRMSG(1,"ISCOpenServer: failed to open %s\n", DEV_SPX, 0,0 );
+ prmsg(1,"ISCOpenServer: failed to open %s\n", DEV_SPX);
return -1;
}
if( (connect_spipe(fds, fd) < 0) ||
(named_spipe(fds, server_path) < 0)) {
- PRMSG(1,"ISCOpenServer: failed connect pipes\n", 0,0,0 );
+ prmsg(1,"ISCOpenServer: failed connect pipes\n");
close(fd);
close(fds);
return -1;
@@ -1087,8 +1080,8 @@ TRANS(ISCOpenServer)(XtransConnInfo ciptr, char *port)
#define X_UNIX_DIR "/tmp/.X11-unix"
if (trans_mkdir(X_UNIX_DIR, mode) == -1) {
- PRMSG (1, "ISCOpenServer: mkdir(%s) failed, errno = %d\n",
- X_UNIX_DIR, errno, 0);
+ prmsg (1, "ISCOpenServer: mkdir(%s) failed, errno = %d\n",
+ X_UNIX_DIR, errno);
return(-1);
}
@@ -1097,8 +1090,8 @@ TRANS(ISCOpenServer)(XtransConnInfo ciptr, char *port)
#ifdef SVR4
/* we prefer symbolic links because hard links can't cross file systems */
if( symlink(server_path, server_unix_path) < 0 )
- PRMSG(1,"ISCOpenServer: failed to link %s to %s\n",
- server_path, server_unix_path, 0 );
+ prmsg(1,"ISCOpenServer: failed to link %s to %s\n",
+ server_path, server_unix_path);
/*
* Don't make this failure fatal since the listener
* is already established, and this just for compatability
@@ -1112,8 +1105,8 @@ TRANS(ISCOpenServer)(XtransConnInfo ciptr, char *port)
#ifdef ISC40
if( symlink(server_path, server_unix_path) < 0 )
#endif
- PRMSG(1,"ISCOpenServer: failed to link %s to %s\n",
- server_path, server_unix_path, 0 );
+ prmsg(1,"ISCOpenServer: failed to link %s to %s\n",
+ server_path, server_unix_path);
/*
* Don't make this failure fatal since the listener
* is already established, and this just for compatability
@@ -1127,7 +1120,7 @@ TRANS(ISCOpenServer)(XtransConnInfo ciptr, char *port)
if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0)
{
- PRMSG(1,"ISCOpenServer: failed to fill in addr info\n", 0, 0, 0);
+ prmsg(1,"ISCOpenServer: failed to fill in addr info\n");
close(fd);
return -1;
}
@@ -1143,11 +1136,11 @@ TRANS(ISCAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
{
struct strrecvfd str;
- PRMSG(2,"ISCAccept(%d)\n", ciptr->fd, 0,0 );
+ prmsg(2,"ISCAccept(%d)\n", ciptr->fd);
while (ioctl(ciptr->fd, I_RECVFD, &str) < 0) {
if (errno != EAGAIN) {
- PRMSG(1,"ISCAccept: Can't read fildes", 0,0,0 );
+ prmsg(1,"ISCAccept: Can't read fildes");
*status = TRANS_ACCEPT_MISC_ERROR;
return(-1);
}
@@ -1159,9 +1152,8 @@ TRANS(ISCAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
newciptr->addrlen=ciptr->addrlen;
if( (newciptr->addr=(char *)malloc(newciptr->addrlen)) == NULL ) {
- PRMSG(1,
- "ISCAccept: failed to allocate memory for peer addr\n",
- 0,0,0);
+ prmsg(1,
+ "ISCAccept: failed to allocate memory for peer addr\n");
close(str.fd);
*status = TRANS_ACCEPT_BAD_MALLOC;
return -1;
@@ -1171,9 +1163,8 @@ TRANS(ISCAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
newciptr->peeraddrlen=newciptr->addrlen;
if( (newciptr->peeraddr=(char *)malloc(newciptr->peeraddrlen)) == NULL ) {
- PRMSG(1,
- "ISCAccept: failed to allocate memory for peer addr\n",
- 0,0,0);
+ prmsg(1,
+ "ISCAccept: failed to allocate memory for peer addr\n");
free(newciptr->addr);
close(str.fd);
*status = TRANS_ACCEPT_BAD_MALLOC;
@@ -1223,23 +1214,23 @@ TRANS(SCOOpenClient)(XtransConnInfo ciptr, char *port)
extern int getmsg(), putmsg();
#endif
- PRMSG(2,"SCOOpenClient(%s)\n", port, 0,0 );
+ prmsg(2,"SCOOpenClient(%s)\n", port);
if (!port || !port[0])
port = "0";
#if !defined(SCORNODENAME)
- PRMSG(2,"SCOOpenClient: Protocol is not supported by a SCO connection\n", 0,0,0);
+ prmsg(2,"SCOOpenClient: Protocol is not supported by a SCO connection\n");
return -1;
#else
(void) sprintf(server_path, SCORNODENAME, port);
if ((server = open(server_path, O_RDWR)) < 0) {
- PRMSG(1,"SCOOpenClient: failed to open %s\n", server_path, 0,0 );
+ prmsg(1,"SCOOpenClient: failed to open %s\n", server_path);
return -1;
}
if ((fd = open(DEV_SPX, O_RDWR)) < 0) {
- PRMSG(1,"SCOOpenClient: failed to open %s\n", DEV_SPX, 0,0 );
+ prmsg(1,"SCOOpenClient: failed to open %s\n", DEV_SPX);
close(server);
return -1;
}
@@ -1259,7 +1250,7 @@ TRANS(SCOOpenClient)(XtransConnInfo ciptr, char *port)
(void) signal(SIGALRM, savef);
if (ret < 0) {
- PRMSG(1,"SCOOpenClient: error from getmsg\n", 0,0,0 );
+ prmsg(1,"SCOOpenClient: error from getmsg\n");
close(fd);
close(server);
return -1;
@@ -1283,7 +1274,7 @@ TRANS(SCOOpenClient)(XtransConnInfo ciptr, char *port)
#endif
if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0)
{
- PRMSG(1,"SCOOpenClient: failed to fill addr info\n", 0, 0, 0);
+ prmsg(1,"SCOOpenClient: failed to fill addr info\n");
close(fd);
return -1;
}
@@ -1309,12 +1300,12 @@ TRANS(SCOOpenServer)(XtransConnInfo ciptr, char *port)
int fds = -1;
#endif
- PRMSG(2,"SCOOpenServer(%s)\n", port, 0,0 );
+ prmsg(2,"SCOOpenServer(%s)\n", port);
if (!port || !port[0])
port = "0";
#if !defined(SCORNODENAME)
- PRMSG(1,"SCOOpenServer: Protocol is not supported by a SCO connection\n", 0,0,0);
+ prmsg(1,"SCOOpenServer: Protocol is not supported by a SCO connection\n");
return -1;
#else
(void) sprintf(serverR_path, SCORNODENAME, port);
@@ -1326,19 +1317,19 @@ TRANS(SCOOpenServer)(XtransConnInfo ciptr, char *port)
if ((fds = open(DEV_SPX, O_RDWR)) < 0 ||
(fdr = open(DEV_SPX, O_RDWR)) < 0 ) {
- PRMSG(1,"SCOOpenServer: failed to open %s\n", DEV_SPX, 0,0 );
+ prmsg(1,"SCOOpenServer: failed to open %s\n", DEV_SPX);
return -1;
}
if (named_spipe (fds, serverS_path) == -1) {
- PRMSG(1,"SCOOpenServer: failed to create %s\n", serverS_path, 0, 0);
+ prmsg(1,"SCOOpenServer: failed to create %s\n", serverS_path);
close (fdr);
close (fds);
return -1;
}
if (named_spipe (fdr, serverR_path) == -1) {
- PRMSG(1,"SCOOpenServer: failed to create %s\n", serverR_path, 0, 0);
+ prmsg(1,"SCOOpenServer: failed to create %s\n", serverR_path);
close (fdr);
close (fds);
return -1;
@@ -1347,7 +1338,7 @@ TRANS(SCOOpenServer)(XtransConnInfo ciptr, char *port)
fds = open (serverS_path, O_RDWR | O_NDELAY);
if (fds < 0) {
- PRMSG(1,"SCOOpenServer: failed to open %s\n", serverS_path, 0, 0);
+ prmsg(1,"SCOOpenServer: failed to open %s\n", serverS_path);
return -1;
}
@@ -1360,22 +1351,22 @@ TRANS(SCOOpenServer)(XtransConnInfo ciptr, char *port)
mylock.l_start = 0;
mylock.l_len = 0;
if (fcntl (fds, F_SETLK, &mylock) < 0) {
- PRMSG(1,"SCOOpenServer: failed to lock %s\n", serverS_path, 0, 0);
+ prmsg(1,"SCOOpenServer: failed to lock %s\n", serverS_path);
close (fds);
return -1;
}
fdr = open (serverR_path, O_RDWR | O_NDELAY);
if (fds < 0) {
- PRMSG(1,"SCOOpenServer: failed to open %s\n", serverR_path, 0, 0);
+ prmsg(1,"SCOOpenServer: failed to open %s\n", serverR_path);
close (fds);
return -1;
}
#endif /* X11_t */
if (connect_spipe(fds, fdr)) {
- PRMSG(1,"SCOOpenServer: ioctl(I_FDINSERT) failed on %s\n",
- serverS_path, 0, 0);
+ prmsg(1,"SCOOpenServer: ioctl(I_FDINSERT) failed on %s\n",
+ serverS_path);
close (fdr);
close (fds);
return -1;
@@ -1389,7 +1380,7 @@ TRANS(SCOOpenServer)(XtransConnInfo ciptr, char *port)
ciptr->flags |= TRANS_NOUNLINK;
#endif
if (TRANS(FillAddrInfo) (ciptr, serverS_path, serverR_path) == 0) {
- PRMSG(1,"SCOOpenServer: failed to fill in addr info\n", 0,0,0);
+ prmsg(1,"SCOOpenServer: failed to fill in addr info\n");
close(fds);
close(fdr);
return -1;
@@ -1406,22 +1397,22 @@ TRANS(SCOAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
char c;
int fd;
- PRMSG(2,"SCOAccept(%d)\n", ciptr->fd, 0,0 );
+ prmsg(2,"SCOAccept(%d)\n", ciptr->fd);
if (read(ciptr->fd, &c, 1) < 0) {
- PRMSG(1,"SCOAccept: can't read from client\n",0,0,0);
+ prmsg(1,"SCOAccept: can't read from client\n");
*status = TRANS_ACCEPT_MISC_ERROR;
return(-1);
}
if( (fd = open(DEV_SPX, O_RDWR)) < 0 ) {
- PRMSG(1,"SCOAccept: can't open \"%s\"\n",DEV_SPX, 0,0 );
+ prmsg(1,"SCOAccept: can't open \"%s\"\n",DEV_SPX);
*status = TRANS_ACCEPT_MISC_ERROR;
return(-1);
}
if (connect_spipe (ciptr->fd, fd) < 0) {
- PRMSG(1,"SCOAccept: ioctl(I_FDINSERT) failed\n", 0, 0, 0);
+ prmsg(1,"SCOAccept: ioctl(I_FDINSERT) failed\n");
close (fd);
*status = TRANS_ACCEPT_MISC_ERROR;
return -1;
@@ -1433,9 +1424,8 @@ TRANS(SCOAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
newciptr->addrlen=ciptr->addrlen;
if( (newciptr->addr=(char *)malloc(newciptr->addrlen)) == NULL ) {
- PRMSG(1,
- "SCOAccept: failed to allocate memory for peer addr\n",
- 0,0,0);
+ prmsg(1,
+ "SCOAccept: failed to allocate memory for peer addr\n");
close(fd);
*status = TRANS_ACCEPT_BAD_MALLOC;
return -1;
@@ -1448,9 +1438,8 @@ TRANS(SCOAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
newciptr->peeraddrlen=newciptr->addrlen;
if( (newciptr->peeraddr=(char *)malloc(newciptr->peeraddrlen)) == NULL ) {
- PRMSG(1,
- "SCOAccept: failed to allocate memory for peer addr\n",
- 0,0,0);
+ prmsg(1,
+ "SCOAccept: failed to allocate memory for peer addr\n");
free(newciptr->addr);
close(fd);
*status = TRANS_ACCEPT_BAD_MALLOC;
@@ -1480,10 +1469,10 @@ TRANS(PTSReopenServer)(XtransConnInfo ciptr, int fd, char *port)
char server_path[64];
#endif
- PRMSG(2,"PTSReopenServer(%d,%s)\n", fd, port, 0 );
+ prmsg(2,"PTSReopenServer(%d,%s)\n", fd, port);
#if !defined(PTSNODENAME)
- PRMSG(1,"PTSReopenServer: Protocol is not supported by a pts connection\n", 0,0,0);
+ prmsg(1,"PTSReopenServer: Protocol is not supported by a pts connection\n");
return 0;
#else
if (port && *port ) {
@@ -1498,8 +1487,7 @@ TRANS(PTSReopenServer)(XtransConnInfo ciptr, int fd, char *port)
if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0)
{
- PRMSG(1,"PTSReopenServer: failed to fill in addr info\n",
- 0,0,0);
+ prmsg(1,"PTSReopenServer: failed to fill in addr info\n");
return 0;
}
@@ -1518,10 +1506,10 @@ TRANS(NAMEDReopenServer)(XtransConnInfo ciptr, int fd, char *port)
char server_path[64];
#endif
- PRMSG(2,"NAMEDReopenServer(%s)\n", port, 0,0 );
+ prmsg(2,"NAMEDReopenServer(%s)\n", port);
#if !defined(NAMEDNODENAME)
- PRMSG(1,"NAMEDReopenServer: Protocol is not supported by a NAMED connection\n", 0,0,0);
+ prmsg(1,"NAMEDReopenServer: Protocol is not supported by a NAMED connection\n");
return 0;
#else
if ( port && *port ) {
@@ -1536,8 +1524,7 @@ TRANS(NAMEDReopenServer)(XtransConnInfo ciptr, int fd, char *port)
if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0)
{
- PRMSG(1,"NAMEDReopenServer: failed to fill in addr info\n",
- 0,0,0);
+ prmsg(1,"NAMEDReopenServer: failed to fill in addr info\n");
return 0;
}
@@ -1556,10 +1543,10 @@ TRANS(ISCReopenServer)(XtransConnInfo ciptr, int fd, char *port)
char server_path[64], server_unix_path[64];
#endif
- PRMSG(2,"ISCReopenServer(%s)\n", port, 0,0 );
+ prmsg(2,"ISCReopenServer(%s)\n", port);
#if !defined(ISCDEVNODENAME)
- PRMSG(1,"ISCReopenServer: Protocol is not supported by a ISC connection\n", 0,0,0);
+ prmsg(1,"ISCReopenServer: Protocol is not supported by a ISC connection\n");
return 0;
#else
(void) sprintf(server_path, ISCDEVNODENAME, port);
@@ -1567,7 +1554,7 @@ TRANS(ISCReopenServer)(XtransConnInfo ciptr, int fd, char *port)
if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0)
{
- PRMSG(1, "ISCReopenServer: failed to fill in addr info\n", 0,0,0);
+ prmsg(1, "ISCReopenServer: failed to fill in addr info\n");
return 0;
}
@@ -1585,12 +1572,12 @@ TRANS(SCOReopenServer)(XtransConnInfo ciptr, int fd, char *port)
char serverR_path[64], serverS_path[64];
#endif
- PRMSG(2,"SCOReopenServer(%s)\n", port, 0,0 );
+ prmsg(2,"SCOReopenServer(%s)\n", port);
if (!port || !port[0])
port = "0";
#if !defined(SCORNODENAME)
- PRMSG(2,"SCOReopenServer: Protocol is not supported by a SCO connection\n", 0,0,0);
+ prmsg(2,"SCOReopenServer: Protocol is not supported by a SCO connection\n");
return 0;
#else
(void) sprintf(serverR_path, SCORNODENAME, port);
@@ -1601,7 +1588,7 @@ TRANS(SCOReopenServer)(XtransConnInfo ciptr, int fd, char *port)
#endif
if (TRANS(FillAddrInfo) (ciptr, serverS_path, serverR_path) == 0)
{
- PRMSG(1, "SCOReopenServer: failed to fill in addr info\n", 0,0,0);
+ prmsg(1, "SCOReopenServer: failed to fill in addr info\n");
return 0;
}
@@ -1886,7 +1873,7 @@ static void
TRANS(LocalInitTransports)(char *protocol)
{
- PRMSG(3,"LocalInitTransports(%s)\n", protocol, 0,0 );
+ prmsg(3,"LocalInitTransports(%s)\n", protocol);
if( strcmp(protocol,"local") && strcmp(protocol,"LOCAL") )
{
@@ -1908,7 +1895,7 @@ static void
TRANS(LocalEndTransports)(void)
{
- PRMSG(3,"LocalEndTransports()\n", 0,0,0 );
+ prmsg(3,"LocalEndTransports()\n");
free(freeXLOCAL);
}
@@ -1923,7 +1910,7 @@ TRANS(LocalGetNextTransport)(void)
int i,j;
char *typetocheck;
char typebuf[TYPEBUFSIZE];
- PRMSG(3,"LocalGetNextTransport()\n", 0,0,0 );
+ prmsg(3,"LocalGetNextTransport()\n");
while(1)
{
@@ -2003,7 +1990,7 @@ TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port)
XtransConnInfo ciptr;
int index;
- PRMSG(3,"LocalOpenClient()\n", 0,0,0 );
+ prmsg(3,"LocalOpenClient()\n");
/*
* Make sure 'host' is really local. If not, we return failure.
@@ -2015,9 +2002,9 @@ TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port)
if (strcmp (host, "unix") != 0 && !HostReallyLocal (host))
{
- PRMSG (1,
+ prmsg (1,
"LocalOpenClient: Cannot connect to non-local host %s\n",
- host, 0, 0);
+ host);
return NULL;
}
@@ -2036,8 +2023,8 @@ TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port)
if( (ciptr=(XtransConnInfo)calloc(1,sizeof(struct _XtransConnInfo))) == NULL )
{
- PRMSG(1,"LocalOpenClient: calloc(1,%d) failed\n",
- sizeof(struct _XtransConnInfo),0,0 );
+ prmsg(1,"LocalOpenClient: calloc(1,%d) failed\n",
+ sizeof(struct _XtransConnInfo));
return NULL;
}
@@ -2059,14 +2046,13 @@ TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port)
break;
case XTRANS_OPEN_COTS_SERVER:
case XTRANS_OPEN_CLTS_SERVER:
- PRMSG(1,
- "LocalOpenClient: Should not be opening a server with this function\n",
- 0,0,0);
+ prmsg(1,
+ "LocalOpenClient: Should not be opening a server with this function\n");
break;
default:
- PRMSG(1,
+ prmsg(1,
"LocalOpenClient: Unknown Open type %d\n",
- type, 0,0 );
+ type);
}
if( ciptr->fd >= 0 )
break;
@@ -2098,7 +2084,7 @@ TRANS(LocalOpenServer)(int type, char *protocol, char *host, char *port)
int i;
XtransConnInfo ciptr;
- PRMSG(2,"LocalOpenServer(%d,%s,%s)\n", type, protocol, port);
+ prmsg(2,"LocalOpenServer(%d,%s,%s)\n", type, protocol, port);
#if defined(X11_t)
/*
@@ -2111,8 +2097,8 @@ TRANS(LocalOpenServer)(int type, char *protocol, char *host, char *port)
if( (ciptr=(XtransConnInfo)calloc(1,sizeof(struct _XtransConnInfo))) == NULL )
{
- PRMSG(1,"LocalOpenServer: calloc(1,%d) failed\n",
- sizeof(struct _XtransConnInfo),0,0 );
+ prmsg(1,"LocalOpenServer: calloc(1,%d) failed\n",
+ sizeof(struct _XtransConnInfo));
return NULL;
}
@@ -2124,9 +2110,8 @@ TRANS(LocalOpenServer)(int type, char *protocol, char *host, char *port)
{
case XTRANS_OPEN_COTS_CLIENT:
case XTRANS_OPEN_CLTS_CLIENT:
- PRMSG(1,
- "LocalOpenServer: Should not be opening a client with this function\n",
- 0,0,0);
+ prmsg(1,
+ "LocalOpenServer: Should not be opening a client with this function\n");
break;
case XTRANS_OPEN_COTS_SERVER:
ciptr->fd=LOCALtrans2devtab[i].devcotsopenserver(ciptr,port);
@@ -2135,8 +2120,8 @@ TRANS(LocalOpenServer)(int type, char *protocol, char *host, char *port)
ciptr->fd=LOCALtrans2devtab[i].devcltsopenserver(ciptr,port);
break;
default:
- PRMSG(1,"LocalOpenServer: Unknown Open type %d\n",
- type ,0,0);
+ prmsg(1,"LocalOpenServer: Unknown Open type %d\n",
+ type );
}
if( ciptr->fd >= 0 ) {
ciptr->priv=(char *)&LOCALtrans2devtab[i];
@@ -2162,12 +2147,12 @@ TRANS(LocalReopenServer)(int type, int index, int fd, char *port)
XtransConnInfo ciptr;
int stat = 0;
- PRMSG(2,"LocalReopenServer(%d,%d,%d)\n", type, index, fd);
+ prmsg(2,"LocalReopenServer(%d,%d,%d)\n", type, index, fd);
if( (ciptr=(XtransConnInfo)calloc(1,sizeof(struct _XtransConnInfo))) == NULL )
{
- PRMSG(1,"LocalReopenServer: calloc(1,%d) failed\n",
- sizeof(struct _XtransConnInfo),0,0 );
+ prmsg(1,"LocalReopenServer: calloc(1,%d) failed\n",
+ sizeof(struct _XtransConnInfo));
return NULL;
}
@@ -2182,8 +2167,8 @@ TRANS(LocalReopenServer)(int type, int index, int fd, char *port)
stat = LOCALtrans2devtab[index].devcltsreopenserver(ciptr,fd,port);
break;
default:
- PRMSG(1,"LocalReopenServer: Unknown Open type %d\n",
- type ,0,0);
+ prmsg(1,"LocalReopenServer: Unknown Open type %d\n",
+ type );
}
if( stat > 0 ) {
@@ -2212,7 +2197,7 @@ TRANS(LocalOpenCOTSClient)(Xtransport *thistrans, char *protocol,
char *host, char *port)
{
- PRMSG(2,"LocalOpenCOTSClient(%s,%s,%s)\n",protocol,host,port);
+ prmsg(2,"LocalOpenCOTSClient(%s,%s,%s)\n",protocol,host,port);
return TRANS(LocalOpenClient)(XTRANS_OPEN_COTS_CLIENT, protocol, host, port);
}
@@ -2231,7 +2216,7 @@ TRANS(LocalOpenCOTSServer)(Xtransport *thistrans, char *protocol,
int found = 0;
char typebuf[TYPEBUFSIZE];
- PRMSG(2,"LocalOpenCOTSServer(%s,%s,%s)\n",protocol,host,port);
+ prmsg(2,"LocalOpenCOTSServer(%s,%s,%s)\n",protocol,host,port);
/* Check if this local type is in the XLOCAL list */
TRANS(LocalInitTransports)("local");
@@ -2253,7 +2238,7 @@ TRANS(LocalOpenCOTSServer)(Xtransport *thistrans, char *protocol,
TRANS(LocalEndTransports)();
if (!found) {
- PRMSG(3,"LocalOpenCOTSServer: disabling %s\n",thistrans->TransName,0,0);
+ prmsg(3,"LocalOpenCOTSServer: disabling %s\n",thistrans->TransName);
thistrans->flags |= TRANS_DISABLED;
return NULL;
}
@@ -2271,7 +2256,7 @@ TRANS(LocalOpenCLTSClient)(Xtransport *thistrans, char *protocol,
char *host, char *port)
{
- PRMSG(2,"LocalOpenCLTSClient(%s,%s,%s)\n",protocol,host,port);
+ prmsg(2,"LocalOpenCLTSClient(%s,%s,%s)\n",protocol,host,port);
return TRANS(LocalOpenClient)(XTRANS_OPEN_CLTS_CLIENT, protocol, host, port);
}
@@ -2286,7 +2271,7 @@ TRANS(LocalOpenCLTSServer)(Xtransport *thistrans, char *protocol,
char *host, char *port)
{
- PRMSG(2,"LocalOpenCLTSServer(%s,%s,%s)\n",protocol,host,port);
+ prmsg(2,"LocalOpenCLTSServer(%s,%s,%s)\n",protocol,host,port);
return TRANS(LocalOpenServer)(XTRANS_OPEN_CLTS_SERVER, protocol, host, port);
}
@@ -2302,7 +2287,7 @@ TRANS(LocalReopenCOTSServer)(Xtransport *thistrans, int fd, char *port)
{
int index;
- PRMSG(2,"LocalReopenCOTSServer(%d,%s)\n", fd, port, 0);
+ prmsg(2,"LocalReopenCOTSServer(%d,%s)\n", fd, port);
for(index=1;index<NUMTRANSPORTS;index++)
{
@@ -2326,7 +2311,7 @@ TRANS(LocalReopenCLTSServer)(Xtransport *thistrans, int fd, char *port)
{
int index;
- PRMSG(2,"LocalReopenCLTSServer(%d,%s)\n", fd, port, 0);
+ prmsg(2,"LocalReopenCLTSServer(%d,%s)\n", fd, port);
for(index=1;index<NUMTRANSPORTS;index++)
{
@@ -2352,7 +2337,7 @@ static int
TRANS(LocalSetOption)(XtransConnInfo ciptr, int option, int arg)
{
- PRMSG(2,"LocalSetOption(%d,%d,%d)\n",ciptr->fd,option,arg);
+ prmsg(2,"LocalSetOption(%d,%d,%d)\n",ciptr->fd,option,arg);
return -1;
}
@@ -2364,7 +2349,7 @@ static int
TRANS(LocalCreateListener)(XtransConnInfo ciptr, char *port, unsigned int flags)
{
- PRMSG(2,"LocalCreateListener(%x->%d,%s)\n",ciptr,ciptr->fd,port);
+ prmsg(2,"LocalCreateListener(%x->%d,%s)\n",ciptr,ciptr->fd,port);
return 0;
}
@@ -2376,14 +2361,14 @@ TRANS(LocalAccept)(XtransConnInfo ciptr, int *status)
XtransConnInfo newciptr;
LOCALtrans2dev *transptr;
- PRMSG(2,"LocalAccept(%x->%d)\n", ciptr, ciptr->fd,0);
+ prmsg(2,"LocalAccept(%x->%d)\n", ciptr, ciptr->fd);
transptr=(LOCALtrans2dev *)ciptr->priv;
if( (newciptr=(XtransConnInfo)calloc(1,sizeof(struct _XtransConnInfo)))==NULL )
{
- PRMSG(1,"LocalAccept: calloc(1,%d) failed\n",
- sizeof(struct _XtransConnInfo),0,0 );
+ prmsg(1,"LocalAccept: calloc(1,%d) failed\n",
+ sizeof(struct _XtransConnInfo));
*status = TRANS_ACCEPT_BAD_MALLOC;
return NULL;
}
@@ -2413,7 +2398,7 @@ static int
TRANS(LocalConnect)(XtransConnInfo ciptr, char *host, char *port)
{
- PRMSG(2,"LocalConnect(%x->%d,%s)\n", ciptr, ciptr->fd, port);
+ prmsg(2,"LocalConnect(%x->%d,%s)\n", ciptr, ciptr->fd, port);
return 0;
}
@@ -2425,7 +2410,7 @@ static int
TRANS(LocalBytesReadable)(XtransConnInfo ciptr, BytesReadable_t *pend )
{
- PRMSG(2,"LocalBytesReadable(%x->%d,%x)\n", ciptr, ciptr->fd, pend);
+ prmsg(2,"LocalBytesReadable(%x->%d,%x)\n", ciptr, ciptr->fd, pend);
#if defined(ISC) || defined(SCO325)
return ioctl(ciptr->fd, I_NREAD, (char *)pend);
@@ -2438,7 +2423,7 @@ static int
TRANS(LocalRead)(XtransConnInfo ciptr, char *buf, int size)
{
- PRMSG(2,"LocalRead(%d,%x,%d)\n", ciptr->fd, buf, size );
+ prmsg(2,"LocalRead(%d,%x,%d)\n", ciptr->fd, buf, size );
return read(ciptr->fd,buf,size);
}
@@ -2447,7 +2432,7 @@ static int
TRANS(LocalWrite)(XtransConnInfo ciptr, char *buf, int size)
{
- PRMSG(2,"LocalWrite(%d,%x,%d)\n", ciptr->fd, buf, size );
+ prmsg(2,"LocalWrite(%d,%x,%d)\n", ciptr->fd, buf, size );
return write(ciptr->fd,buf,size);
}
@@ -2456,7 +2441,7 @@ static int
TRANS(LocalReadv)(XtransConnInfo ciptr, struct iovec *buf, int size)
{
- PRMSG(2,"LocalReadv(%d,%x,%d)\n", ciptr->fd, buf, size );
+ prmsg(2,"LocalReadv(%d,%x,%d)\n", ciptr->fd, buf, size );
return READV(ciptr,buf,size);
}
@@ -2465,7 +2450,7 @@ static int
TRANS(LocalWritev)(XtransConnInfo ciptr, struct iovec *buf, int size)
{
- PRMSG(2,"LocalWritev(%d,%x,%d)\n", ciptr->fd, buf, size );
+ prmsg(2,"LocalWritev(%d,%x,%d)\n", ciptr->fd, buf, size );
return WRITEV(ciptr,buf,size);
}
@@ -2474,7 +2459,7 @@ static int
TRANS(LocalDisconnect)(XtransConnInfo ciptr)
{
- PRMSG(2,"LocalDisconnect(%x->%d)\n", ciptr, ciptr->fd, 0);
+ prmsg(2,"LocalDisconnect(%x->%d)\n", ciptr, ciptr->fd);
return 0;
}
@@ -2486,7 +2471,7 @@ TRANS(LocalClose)(XtransConnInfo ciptr)
struct sockaddr_un *sockname=(struct sockaddr_un *) ciptr->addr;
int ret;
- PRMSG(2,"LocalClose(%x->%d)\n", ciptr, ciptr->fd ,0);
+ prmsg(2,"LocalClose(%x->%d)\n", ciptr, ciptr->fd );
ret=close(ciptr->fd);
@@ -2508,7 +2493,7 @@ TRANS(LocalCloseForCloning)(XtransConnInfo ciptr)
{
int ret;
- PRMSG(2,"LocalCloseForCloning(%x->%d)\n", ciptr, ciptr->fd ,0);
+ prmsg(2,"LocalCloseForCloning(%x->%d)\n", ciptr, ciptr->fd );
/* Don't unlink path */
diff --git a/nx-X11/lib/xtrans/Xtranssock.c b/nx-X11/lib/xtrans/Xtranssock.c
index a84255988..ae00776e4 100644
--- a/nx-X11/lib/xtrans/Xtranssock.c
+++ b/nx-X11/lib/xtrans/Xtranssock.c
@@ -345,7 +345,7 @@ void TRANS(SocketRejectConnection) (XtransConnInfo ciptr)
struct timeval t;
int f;
- PRMSG (3, "SocketRejectConnection(%x)\n", ciptr, 0, 0);
+ prmsg (3, "SocketRejectConnection(%x)\n", ciptr);
FD_ZERO(&fs);
FD_SET(ciptr -> fd, &fs);
@@ -404,7 +404,7 @@ static XtransConnInfo TRANS(SocketCreateConnInfo) ()
if ((ciptr = (XtransConnInfo) calloc (1, sizeof(struct _XtransConnInfo))) == NULL)
{
- PRMSG (1, "SocketCreateConnInfo: malloc failed\n", 0, 0, 0);
+ prmsg (1, "SocketCreateConnInfo: malloc failed\n");
return NULL;
}
@@ -419,7 +419,7 @@ static XtransConnInfo TRANS(SocketCreateConnInfo) ()
if (socketpair(PF_LOCAL, SOCK_STREAM, 0, fds) < 0)
{
- PRMSG (1, "SocketCreateConnInfo: socketpair() failed.\n", 0, 0, 0);
+ prmsg (1, "SocketCreateConnInfo: socketpair() failed.\n");
free ((char *) ciptr);
return NULL;
}
@@ -442,15 +442,15 @@ static XtransConnInfo TRANS(SocketCreateConnInfo) ()
if (ciptr->fd >= NX_PROXY_CONN_LIMIT)
{
- PRMSG (1, "SocketCreateConnInfo: No space for a new _NXProxyConnInfo for [%d].\n",
- ciptr->fd, 0, 0);
+ prmsg (1, "SocketCreateConnInfo: No space for a new _NXProxyConnInfo for [%d].\n",
+ ciptr->fd);
free ((char *) ciptr);
return NULL;
}
else if (_NXProxyConnInfoTab[ciptr->fd] != NULL)
{
- PRMSG (1, "SocketCreateConnInfo: _NXProxyConnInfo for [%d] is not NULL. Exiting.\n",
- ciptr->fd, 0, 0);
+ prmsg (1, "SocketCreateConnInfo: _NXProxyConnInfo for [%d] is not NULL. Exiting.\n",
+ ciptr->fd);
exit(1);
}
@@ -458,7 +458,7 @@ static XtransConnInfo TRANS(SocketCreateConnInfo) ()
if (_NXProxyConnInfoTab[ciptr->fd] == NULL)
{
- PRMSG (1, "SocketCreateConnInfo: Alloc of _NXProxyConnInfo failed.\n", 0, 0, 0);
+ prmsg (1, "SocketCreateConnInfo: Alloc of _NXProxyConnInfo failed.\n");
free ((char *) ciptr);
return NULL;
}
@@ -498,21 +498,20 @@ static int TRANS(SocketConnectConnInfo) (XtransConnInfo ciptr, char *host, char
if (proxy_conn == NULL)
{
- PRMSG (1, "SocketConnectConnInfo: Pointer to _NXProxyConnInfo is NULL. Exiting.\n", 0, 0, 0);
+ prmsg (1, "SocketConnectConnInfo: Pointer to _NXProxyConnInfo is NULL. Exiting.\n");
exit(1);
}
else if (_NXProxyConnInfoTab[ciptr->fd] != (_NXProxyConnInfo *) ciptr->priv)
{
- PRMSG (1, "SocketConnectConnInfo: Can't find _NXProxyConnInfo in table. Exiting.\n",
- 0, 0, 0);
+ prmsg (1, "SocketConnectConnInfo: Can't find _NXProxyConnInfo in table. Exiting.\n");
exit(1);
}
if (strlen(host) + strlen(port) + 1 >= 1023)
{
- PRMSG (1, "SocketConnectConnInfo: Length of NX display string '%s:%s' would exceed %d characters.\n",
+ prmsg (1, "SocketConnectConnInfo: Length of NX display string '%s:%s' would exceed %d characters.\n",
host, port, 1023);
return TRANS_CONNECT_FAILED;
@@ -533,8 +532,8 @@ static int TRANS(SocketConnectConnInfo) (XtransConnInfo ciptr, char *host, char
#endif
#endif
{
- PRMSG (1, "SocketConnectConnInfo: Cannot set close-on-exec on local NX descriptor [%d].\n",
- proxy_conn -> local, 0, 0);
+ prmsg (1, "SocketConnectConnInfo: Cannot set close-on-exec on local NX descriptor [%d].\n",
+ proxy_conn -> local);
return TRANS_CONNECT_FAILED;
}
@@ -546,8 +545,7 @@ static int TRANS(SocketConnectConnInfo) (XtransConnInfo ciptr, char *host, char
if (NXTransCreate(NX_FD_ANY, NX_MODE_CLIENT, display) < 0)
{
- PRMSG (1, "SocketConnectConnInfo: Cannot create the NX transport.\n",
- 0, 0, 0);
+ prmsg (1, "SocketConnectConnInfo: Cannot create the NX transport.\n");
return TRANS_CONNECT_FAILED;
}
@@ -577,28 +575,27 @@ static void TRANS(SocketCloseConnInfo) (XtransConnInfo ciptr)
if (proxy_conn == NULL)
{
- PRMSG (1, "SocketCloseConnInfo: Pointer to _NXProxyConnInfo is NULL. Exiting.\n", 0, 0, 0);
+ prmsg (1, "SocketCloseConnInfo: Pointer to _NXProxyConnInfo is NULL. Exiting.\n");
exit(1);
}
else if (ciptr->fd >= NX_PROXY_CONN_LIMIT ||
_NXProxyConnInfoTab[ciptr->fd] != (_NXProxyConnInfo *) ciptr->priv)
{
- PRMSG (1, "SocketCloseConnInfo: Can't find _NXProxyConnInfo in table. Exiting.\n",
- 0, 0, 0);
+ prmsg (1, "SocketCloseConnInfo: Can't find _NXProxyConnInfo in table. Exiting.\n");
exit(1);
}
else if (_NXProxyConnInfoTab[ciptr->fd] -> info != ciptr ||
_NXProxyConnInfoTab[ciptr->fd] -> local != ciptr->fd)
{
- PRMSG (1, "SocketCloseConnInfo: Invalid _NXProxyConnInfo structure for [%d]. Exiting.\n",
- ciptr->fd, 0, 0);
+ prmsg (1, "SocketCloseConnInfo: Invalid _NXProxyConnInfo structure for [%d]. Exiting.\n",
+ ciptr->fd);
exit(1);
}
else if (proxy_conn->local < 0 || proxy_conn->remote < 0)
{
- PRMSG (1, "SocketCloseConnInfo: Invalid socket pair in NX connection for [%d]. Exiting.\n",
- ciptr->fd, 0, 0);
+ prmsg (1, "SocketCloseConnInfo: Invalid socket pair in NX connection for [%d]. Exiting.\n",
+ ciptr->fd);
exit(1);
}
@@ -642,7 +639,7 @@ int TRANS(SocketCongestionChange) (XtransConnInfo ciptr, int *state)
_NXProxyConnInfo *proxy_conn;
- PRMSG (3, "SocketCongestionChange(%x)\n", ciptr, 0, 0);
+ prmsg (3, "SocketCongestionChange(%x)\n", ciptr);
proxy_conn = (_NXProxyConnInfo *) ciptr->priv;
@@ -694,7 +691,7 @@ TRANS(SocketSelectFamily) (int first, char *family)
{
int i;
- PRMSG (3,"SocketSelectFamily(%s)\n", family, 0, 0);
+ prmsg (3,"SocketSelectFamily(%s)\n", family);
for (i = first + 1; i < NUMSOCKETFAMILIES;i++)
{
@@ -728,7 +725,7 @@ TRANS(SocketINETGetAddr) (XtransConnInfo ciptr)
socklen_t namelen;
#endif
- PRMSG (3,"SocketINETGetAddr(%p)\n", ciptr, 0, 0);
+ prmsg (3,"SocketINETGetAddr(%p)\n", ciptr);
#if defined(IPv6) && defined(AF_INET6)
if (haveIPv6)
@@ -749,8 +746,8 @@ TRANS(SocketINETGetAddr) (XtransConnInfo ciptr)
#ifdef WIN32
errno = WSAGetLastError();
#endif
- PRMSG (1,"SocketINETGetAddr: getsockname() failed: %d\n",
- EGET(),0, 0);
+ prmsg (1,"SocketINETGetAddr: getsockname() failed: %d\n",
+ EGET());
return -1;
}
@@ -760,9 +757,8 @@ TRANS(SocketINETGetAddr) (XtransConnInfo ciptr)
if ((ciptr->addr = (char *) malloc (namelen)) == NULL)
{
- PRMSG (1,
- "SocketINETGetAddr: Can't allocate space for the addr\n",
- 0, 0, 0);
+ prmsg (1,
+ "SocketINETGetAddr: Can't allocate space for the addr\n");
return -1;
}
@@ -816,7 +812,7 @@ TRANS(SocketINETGetPeerAddr) (XtransConnInfo ciptr)
socknamePtr = &socknamev4;
}
- PRMSG (3,"SocketINETGetPeerAddr(%p)\n", ciptr, 0, 0);
+ prmsg (3,"SocketINETGetPeerAddr(%p)\n", ciptr);
if (getpeername (ciptr->fd, (struct sockaddr *) socknamePtr,
(void *)&namelen) < 0)
@@ -824,8 +820,8 @@ TRANS(SocketINETGetPeerAddr) (XtransConnInfo ciptr)
#ifdef WIN32
errno = WSAGetLastError();
#endif
- PRMSG (1,"SocketINETGetPeerAddr: getpeername() failed: %d\n",
- EGET(), 0, 0);
+ prmsg (1,"SocketINETGetPeerAddr: getpeername() failed: %d\n",
+ EGET());
return -1;
}
@@ -835,9 +831,8 @@ TRANS(SocketINETGetPeerAddr) (XtransConnInfo ciptr)
if ((ciptr->peeraddr = (char *) malloc (namelen)) == NULL)
{
- PRMSG (1,
- "SocketINETGetPeerAddr: Can't allocate space for the addr\n",
- 0, 0, 0);
+ prmsg (1,
+ "SocketINETGetPeerAddr: Can't allocate space for the addr\n");
return -1;
}
@@ -854,7 +849,7 @@ TRANS(SocketOpen) (int i, int type)
{
XtransConnInfo ciptr;
- PRMSG (3,"SocketOpen(%d,%d)\n", i, type, 0);
+ prmsg (3,"SocketOpen(%d,%d)\n", i, type);
#if defined(IPv6) && defined(AF_INET6)
if (getaddrinfo == NULL)
@@ -867,7 +862,7 @@ TRANS(SocketOpen) (int i, int type)
if ((ciptr = (XtransConnInfo) calloc (
1, sizeof(struct _XtransConnInfo))) == NULL)
{
- PRMSG (1, "SocketOpen: malloc failed\n", 0, 0, 0);
+ prmsg (1, "SocketOpen: malloc failed\n");
return NULL;
}
@@ -882,8 +877,8 @@ TRANS(SocketOpen) (int i, int type)
#ifdef WIN32
errno = WSAGetLastError();
#endif
- PRMSG (2, "SocketOpen: socket() failed for %s\n",
- Sockettrans2devtab[i].transname, 0, 0);
+ prmsg (2, "SocketOpen: socket() failed for %s\n",
+ Sockettrans2devtab[i].transname);
free ((char *) ciptr);
return NULL;
@@ -918,12 +913,12 @@ TRANS(SocketReopen) (int i, int type, int fd, char *port)
{
XtransConnInfo ciptr;
- PRMSG (3,"SocketReopen(%d,%d,%s)\n", type, fd, port);
+ prmsg (3,"SocketReopen(%d,%d,%s)\n", type, fd, port);
if ((ciptr = (XtransConnInfo) calloc (
1, sizeof(struct _XtransConnInfo))) == NULL)
{
- PRMSG (1, "SocketReopen: malloc failed\n", 0, 0, 0);
+ prmsg (1, "SocketReopen: malloc failed\n");
return NULL;
}
@@ -948,7 +943,7 @@ TRANS(SocketOpenCOTSClientBase) (char *transname, char *protocol,
XtransConnInfo ciptr;
int i = previndex;
- PRMSG (2, "SocketOpenCOTSClient(%s,%s,%s)\n",
+ prmsg (2, "SocketOpenCOTSClient(%s,%s,%s)\n",
protocol, host, port);
SocketInitOnce();
@@ -964,8 +959,8 @@ TRANS(SocketOpenCOTSClientBase) (char *transname, char *protocol,
if (ciptr == NULL)
{
- PRMSG (1, "SocketOpenCOTSClient: Unable to create the NX connection info for %s.\n",
- transname, 0, 0);
+ prmsg (1, "SocketOpenCOTSClient: Unable to create the NX connection info for %s.\n",
+ transname);
return NULL;
}
@@ -984,11 +979,11 @@ TRANS(SocketOpenCOTSClientBase) (char *transname, char *protocol,
}
if (i < 0) {
if (i == -1)
- PRMSG (1,"SocketOpenCOTSClient: Unable to open socket for %s\n",
- transname, 0, 0);
+ prmsg (1,"SocketOpenCOTSClient: Unable to open socket for %s\n",
+ transname);
else
- PRMSG (1,"SocketOpenCOTSClient: Unable to determine socket type for %s\n",
- transname, 0, 0);
+ prmsg (1,"SocketOpenCOTSClient: Unable to determine socket type for %s\n",
+ transname);
return NULL;
}
@@ -1027,7 +1022,7 @@ TRANS(SocketOpenCOTSServer) (Xtransport *thistrans, char *protocol,
XtransConnInfo ciptr;
int i = -1;
- PRMSG (2,"SocketOpenCOTSServer(%s,%s,%s)\n", protocol, host, port);
+ prmsg (2,"SocketOpenCOTSServer(%s,%s,%s)\n", protocol, host, port);
SocketInitOnce();
@@ -1038,11 +1033,11 @@ TRANS(SocketOpenCOTSServer) (Xtransport *thistrans, char *protocol,
}
if (i < 0) {
if (i == -1)
- PRMSG (1,"SocketOpenCOTSServer: Unable to open socket for %s\n",
- thistrans->TransName, 0, 0);
+ prmsg (1,"SocketOpenCOTSServer: Unable to open socket for %s\n",
+ thistrans->TransName);
else
- PRMSG (1,"SocketOpenCOTSServer: Unable to determine socket type for %s\n",
- thistrans->TransName, 0, 0);
+ prmsg (1,"SocketOpenCOTSServer: Unable to determine socket type for %s\n",
+ thistrans->TransName);
return NULL;
}
@@ -1094,7 +1089,7 @@ TRANS(SocketOpenCLTSClient) (Xtransport *thistrans, char *protocol,
XtransConnInfo ciptr;
int i = -1;
- PRMSG (2,"SocketOpenCLTSClient(%s,%s,%s)\n", protocol, host, port);
+ prmsg (2,"SocketOpenCLTSClient(%s,%s,%s)\n", protocol, host, port);
SocketInitOnce();
@@ -1109,8 +1104,8 @@ TRANS(SocketOpenCLTSClient) (Xtransport *thistrans, char *protocol,
if (ciptr == NULL)
{
- PRMSG (1, "SocketOpenCLTSClient: Unable to create the NX connection info for %s.\n",
- thistrans->TransName, 0, 0);
+ prmsg (1, "SocketOpenCLTSClient: Unable to create the NX connection info for %s.\n",
+ thistrans->TransName);
return NULL;
}
@@ -1128,11 +1123,11 @@ TRANS(SocketOpenCLTSClient) (Xtransport *thistrans, char *protocol,
}
if (i < 0) {
if (i == -1)
- PRMSG (1,"SocketOpenCLTSClient: Unable to open socket for %s\n",
- thistrans->TransName, 0, 0);
+ prmsg (1,"SocketOpenCLTSClient: Unable to open socket for %s\n",
+ thistrans->TransName);
else
- PRMSG (1,"SocketOpenCLTSClient: Unable to determine socket type for %s\n",
- thistrans->TransName, 0, 0);
+ prmsg (1,"SocketOpenCLTSClient: Unable to determine socket type for %s\n",
+ thistrans->TransName);
return NULL;
}
@@ -1162,7 +1157,7 @@ TRANS(SocketOpenCLTSServer) (Xtransport *thistrans, char *protocol,
XtransConnInfo ciptr;
int i = -1;
- PRMSG (2,"SocketOpenCLTSServer(%s,%s,%s)\n", protocol, host, port);
+ prmsg (2,"SocketOpenCLTSServer(%s,%s,%s)\n", protocol, host, port);
SocketInitOnce();
@@ -1173,11 +1168,11 @@ TRANS(SocketOpenCLTSServer) (Xtransport *thistrans, char *protocol,
}
if (i < 0) {
if (i == -1)
- PRMSG (1,"SocketOpenCLTSServer: Unable to open socket for %s\n",
- thistrans->TransName, 0, 0);
+ prmsg (1,"SocketOpenCLTSServer: Unable to open socket for %s\n",
+ thistrans->TransName);
else
- PRMSG (1,"SocketOpenCLTSServer: Unable to determine socket type for %s\n",
- thistrans->TransName, 0, 0);
+ prmsg (1,"SocketOpenCLTSServer: Unable to determine socket type for %s\n",
+ thistrans->TransName);
return NULL;
}
@@ -1207,8 +1202,8 @@ TRANS(SocketReopenCOTSServer) (Xtransport *thistrans, int fd, char *port)
XtransConnInfo ciptr;
int i = -1;
- PRMSG (2,
- "SocketReopenCOTSServer(%d, %s)\n", fd, port, 0);
+ prmsg (2,
+ "SocketReopenCOTSServer(%d, %s)\n", fd, port);
SocketInitOnce();
@@ -1219,11 +1214,11 @@ TRANS(SocketReopenCOTSServer) (Xtransport *thistrans, int fd, char *port)
}
if (i < 0) {
if (i == -1)
- PRMSG (1,"SocketReopenCOTSServer: Unable to open socket for %s\n",
- thistrans->TransName, 0, 0);
+ prmsg (1,"SocketReopenCOTSServer: Unable to open socket for %s\n",
+ thistrans->TransName);
else
- PRMSG (1,"SocketReopenCOTSServer: Unable to determine socket type for %s\n",
- thistrans->TransName, 0, 0);
+ prmsg (1,"SocketReopenCOTSServer: Unable to determine socket type for %s\n",
+ thistrans->TransName);
return NULL;
}
@@ -1241,8 +1236,8 @@ TRANS(SocketReopenCLTSServer) (Xtransport *thistrans, int fd, char *port)
XtransConnInfo ciptr;
int i = -1;
- PRMSG (2,
- "SocketReopenCLTSServer(%d, %s)\n", fd, port, 0);
+ prmsg (2,
+ "SocketReopenCLTSServer(%d, %s)\n", fd, port);
SocketInitOnce();
@@ -1253,11 +1248,11 @@ TRANS(SocketReopenCLTSServer) (Xtransport *thistrans, int fd, char *port)
}
if (i < 0) {
if (i == -1)
- PRMSG (1,"SocketReopenCLTSServer: Unable to open socket for %s\n",
- thistrans->TransName, 0, 0);
+ prmsg (1,"SocketReopenCLTSServer: Unable to open socket for %s\n",
+ thistrans->TransName);
else
- PRMSG (1,"SocketReopenCLTSServer: Unable to determine socket type for %s\n",
- thistrans->TransName, 0, 0);
+ prmsg (1,"SocketReopenCLTSServer: Unable to determine socket type for %s\n",
+ thistrans->TransName);
return NULL;
}
@@ -1275,7 +1270,7 @@ static int
TRANS(SocketSetOption) (XtransConnInfo ciptr, int option, int arg)
{
- PRMSG (2,"SocketSetOption(%d,%d,%d)\n", ciptr->fd, option, arg);
+ prmsg (2,"SocketSetOption(%d,%d,%d)\n", ciptr->fd, option, arg);
#ifdef NX_TRANS_TEST
fprintf(stderr, "SocketSetOption: WARNING! Not setting option [%d] with value [%d] on descriptor [%d].\n",
@@ -1325,7 +1320,7 @@ TRANS(SocketCreateListener) (XtransConnInfo ciptr,
int fd = ciptr->fd;
int retry;
- PRMSG (3, "SocketCreateListener(%x,%p)\n", ciptr, fd, 0);
+ prmsg (3, "SocketCreateListener(%x,%p)\n", ciptr, fd);
if (Sockettrans2devtab[ciptr->index].family == AF_INET
#if defined(IPv6) && defined(AF_INET6)
@@ -1351,8 +1346,7 @@ TRANS(SocketCreateListener) (XtransConnInfo ciptr,
}
if (retry-- == 0) {
- PRMSG (1, "SocketCreateListener: failed to bind listener\n",
- 0, 0, 0);
+ prmsg (1, "SocketCreateListener: failed to bind listener\n");
close (fd);
return TRANS_CREATE_LISTENER_FAILED;
}
@@ -1383,7 +1377,7 @@ TRANS(SocketCreateListener) (XtransConnInfo ciptr,
if (listen (fd, BACKLOG) < 0)
{
- PRMSG (1, "SocketCreateListener: listen() failed\n", 0, 0, 0);
+ prmsg (1, "SocketCreateListener: listen() failed\n");
close (fd);
return TRANS_CREATE_LISTENER_FAILED;
}
@@ -1423,7 +1417,7 @@ TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, char *port, unsigned int
char portbuf[PORTBUFSIZE];
#endif
- PRMSG (2, "SocketINETCreateListener(%s)\n", port, 0, 0);
+ prmsg (2, "SocketINETCreateListener(%s)\n", port);
#ifdef X11_t
/*
@@ -1452,9 +1446,9 @@ TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, char *port, unsigned int
{
if ((servp = _XGetservbyname (port,"tcp",sparams)) == NULL)
{
- PRMSG (1,
+ prmsg (1,
"SocketINETCreateListener: Unable to get service for %s\n",
- port, 0, 0);
+ port);
return TRANS_CREATE_LISTENER_FAILED;
}
/* we trust getservbyname to return a valid number */
@@ -1509,17 +1503,15 @@ TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, char *port, unsigned int
if ((status = TRANS(SocketCreateListener) (ciptr,
(struct sockaddr *) &sockname, namelen, flags)) < 0)
{
- PRMSG (1,
- "SocketINETCreateListener: ...SocketCreateListener() failed\n",
- 0, 0, 0);
+ prmsg (1,
+ "SocketINETCreateListener: ...SocketCreateListener() failed\n");
return status;
}
if (TRANS(SocketINETGetAddr) (ciptr) < 0)
{
- PRMSG (1,
- "SocketINETCreateListener: ...SocketINETGetAddr() failed\n",
- 0, 0, 0);
+ prmsg (1,
+ "SocketINETCreateListener: ...SocketINETGetAddr() failed\n");
return TRANS_CREATE_LISTENER_FAILED;
}
@@ -1548,8 +1540,8 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port,
abstract = ciptr->transptr->flags & TRANS_ABSTRACT;
#endif
- PRMSG (2, "SocketUNIXCreateListener(%s)\n",
- port ? port : "NULL", 0, 0);
+ prmsg (2, "SocketUNIXCreateListener(%s)\n",
+ port ? port : "NULL");
/* Make sure the directory is created */
@@ -1563,12 +1555,12 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port,
#endif
#ifdef NX_TRANS_SOCKET
if (!abstract && trans_mkdir(_NXGetUnixDir(UNIX_DIR), mode) == -1) {
- PRMSG (1, "SocketUNIXCreateListener: mkdir(%s) failed, errno = %d\n",
- _NXGetUnixDir(UNIX_DIR), errno, 0);
+ prmsg (1, "SocketUNIXCreateListener: mkdir(%s) failed, errno = %d\n",
+ _NXGetUnixDir(UNIX_DIR), errno);
#else
if (!abstract && trans_mkdir(UNIX_DIR, mode) == -1) {
- PRMSG (1, "SocketUNIXCreateListener: mkdir(%s) failed, errno = %d\n",
- UNIX_DIR, errno, 0);
+ prmsg (1, "SocketUNIXCreateListener: mkdir(%s) failed, errno = %d\n",
+ UNIX_DIR, errno);
#endif
(void) umask (oldUmask);
return TRANS_CREATE_LISTENER_FAILED;
@@ -1588,7 +1580,7 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port,
#else
if (set_sun_path(port, UNIX_PATH, sockname.sun_path, abstract) != 0) {
#endif
- PRMSG (1, "SocketUNIXCreateListener: path too long\n", 0, 0, 0);
+ prmsg (1, "SocketUNIXCreateListener: path too long\n");
return TRANS_CREATE_LISTENER_FAILED;
}
} else {
@@ -1620,9 +1612,8 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port,
if ((status = TRANS(SocketCreateListener) (ciptr,
(struct sockaddr *) &sockname, namelen, flags)) < 0)
{
- PRMSG (1,
- "SocketUNIXCreateListener: ...SocketCreateListener() failed\n",
- 0, 0, 0);
+ prmsg (1,
+ "SocketUNIXCreateListener: ...SocketCreateListener() failed\n");
(void) umask (oldUmask);
return status;
}
@@ -1638,9 +1629,8 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port,
if ((ciptr->addr = (char *) malloc (namelen)) == NULL)
{
- PRMSG (1,
- "SocketUNIXCreateListener: Can't allocate space for the addr\n",
- 0, 0, 0);
+ prmsg (1,
+ "SocketUNIXCreateListener: Can't allocate space for the addr\n");
(void) umask (oldUmask);
return TRANS_CREATE_LISTENER_FAILED;
}
@@ -1675,7 +1665,7 @@ TRANS(SocketUNIXResetListener) (XtransConnInfo ciptr)
abstract = ciptr->transptr->flags & TRANS_ABSTRACT;
#endif
- PRMSG (3, "SocketUNIXResetListener(%p,%d)\n", ciptr, ciptr->fd, 0);
+ prmsg (3, "SocketUNIXResetListener(%p,%d)\n", ciptr, ciptr->fd);
if (!abstract && (
stat (unsock->sun_path, &statb) == -1 ||
@@ -1696,12 +1686,12 @@ TRANS(SocketUNIXResetListener) (XtransConnInfo ciptr)
#endif
#ifdef NX_TRANS_SOCKET
if (trans_mkdir(_NXGetUnixDir(UNIX_DIR), mode) == -1) {
- PRMSG (1, "SocketUNIXResetListener: mkdir(%s) failed, errno = %d\n",
- _NXGetUnixDir(UNIX_DIR), errno, 0);
+ prmsg (1, "SocketUNIXResetListener: mkdir(%s) failed, errno = %d\n",
+ _NXGetUnixDir(UNIX_DIR), errno);
#else
if (trans_mkdir(UNIX_DIR, mode) == -1) {
- PRMSG (1, "SocketUNIXResetListener: mkdir(%s) failed, errno = %d\n",
- UNIX_DIR, errno, 0);
+ prmsg (1, "SocketUNIXResetListener: mkdir(%s) failed, errno = %d\n",
+ UNIX_DIR, errno);
#endif
(void) umask (oldUmask);
return TRANS_RESET_FAILURE;
@@ -1754,12 +1744,12 @@ TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status)
struct sockaddr_in sockname;
int namelen = sizeof(sockname);
- PRMSG (2, "SocketINETAccept(%p,%d)\n", ciptr, ciptr->fd, 0);
+ prmsg (2, "SocketINETAccept(%p,%d)\n", ciptr, ciptr->fd);
if ((newciptr = (XtransConnInfo) calloc (
1, sizeof(struct _XtransConnInfo))) == NULL)
{
- PRMSG (1, "SocketINETAccept: malloc failed\n", 0, 0, 0);
+ prmsg (1, "SocketINETAccept: malloc failed\n");
*status = TRANS_ACCEPT_BAD_MALLOC;
return NULL;
}
@@ -1770,7 +1760,7 @@ TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status)
#ifdef WIN32
errno = WSAGetLastError();
#endif
- PRMSG (1, "SocketINETAccept: accept() failed\n", 0, 0, 0);
+ prmsg (1, "SocketINETAccept: accept() failed\n");
free (newciptr);
*status = TRANS_ACCEPT_FAILED;
return NULL;
@@ -1795,9 +1785,8 @@ TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status)
if (TRANS(SocketINETGetAddr) (newciptr) < 0)
{
- PRMSG (1,
- "SocketINETAccept: ...SocketINETGetAddr() failed:\n",
- 0, 0, 0);
+ prmsg (1,
+ "SocketINETAccept: ...SocketINETGetAddr() failed:\n");
close (newciptr->fd);
free (newciptr);
*status = TRANS_ACCEPT_MISC_ERROR;
@@ -1806,9 +1795,8 @@ TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status)
if (TRANS(SocketINETGetPeerAddr) (newciptr) < 0)
{
- PRMSG (1,
- "SocketINETAccept: ...SocketINETGetPeerAddr() failed:\n",
- 0, 0, 0);
+ prmsg (1,
+ "SocketINETAccept: ...SocketINETGetPeerAddr() failed:\n");
close (newciptr->fd);
if (newciptr->addr) free (newciptr->addr);
free (newciptr);
@@ -1837,12 +1825,12 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status)
int namelen = sizeof sockname;
#endif
- PRMSG (2, "SocketUNIXAccept(%p,%d)\n", ciptr, ciptr->fd, 0);
+ prmsg (2, "SocketUNIXAccept(%p,%d)\n", ciptr, ciptr->fd);
if ((newciptr = (XtransConnInfo) calloc (
1, sizeof(struct _XtransConnInfo))) == NULL)
{
- PRMSG (1, "SocketUNIXAccept: malloc() failed\n", 0, 0, 0);
+ prmsg (1, "SocketUNIXAccept: malloc() failed\n");
*status = TRANS_ACCEPT_BAD_MALLOC;
return NULL;
}
@@ -1850,7 +1838,7 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status)
if ((newciptr->fd = accept (ciptr->fd,
(struct sockaddr *) &sockname, (void *)&namelen)) < 0)
{
- PRMSG (1, "SocketUNIXAccept: accept() failed\n", 0, 0, 0);
+ prmsg (1, "SocketUNIXAccept: accept() failed\n");
free (newciptr);
*status = TRANS_ACCEPT_FAILED;
return NULL;
@@ -1863,9 +1851,8 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status)
if ((newciptr->addr = (char *) malloc (ciptr->addrlen)) == NULL)
{
- PRMSG (1,
- "SocketUNIXAccept: Can't allocate space for the addr\n",
- 0, 0, 0);
+ prmsg (1,
+ "SocketUNIXAccept: Can't allocate space for the addr\n");
close (newciptr->fd);
free (newciptr);
*status = TRANS_ACCEPT_BAD_MALLOC;
@@ -1882,9 +1869,8 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status)
if ((newciptr->peeraddr = (char *) malloc (ciptr->addrlen)) == NULL)
{
- PRMSG (1,
- "SocketUNIXAccept: Can't allocate space for the addr\n",
- 0, 0, 0);
+ prmsg (1,
+ "SocketUNIXAccept: Can't allocate space for the addr\n");
close (newciptr->fd);
if (newciptr->addr) free (newciptr->addr);
free (newciptr);
@@ -1949,7 +1935,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
long tmpport;
char hostnamebuf[256]; /* tmp space */
- PRMSG (2,"SocketINETConnect(%d,%s,%s)\n", ciptr->fd, host, port);
+ prmsg (2,"SocketINETConnect(%d,%s,%s)\n", ciptr->fd, host, port);
if (!host)
{
@@ -2000,7 +1986,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
res = getaddrinfo(host,port,&hints,&addrlist->firstaddr);
if (res != 0) {
- PRMSG (1, "SocketINETConnect() can't get address "
+ prmsg (1, "SocketINETConnect() can't get address "
"for %s:%s: %s\n", host, port, gai_strerror(res));
ESET(EINVAL);
return TRANS_CONNECT_FAILED;
@@ -2009,7 +1995,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
addrlist->addr ; res++) {
addrlist->addr = addrlist->addr->ai_next;
}
- PRMSG(4,"Got New Address list with %d addresses\n", res, 0, 0);
+ prmsg(4,"Got New Address list with %d addresses\n", res);
res = 0;
addrlist->addr = NULL;
}
@@ -2018,8 +2004,8 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
if (addrlist->addr == NULL) {
if (resetonce) {
/* Already checked entire list - no usable addresses */
- PRMSG (1, "SocketINETConnect() no usable address "
- "for %s:%s\n", host, port, 0);
+ prmsg (1, "SocketINETConnect() no usable address "
+ "for %s:%s\n", host, port);
return TRANS_CONNECT_FAILED;
} else {
/* Go back to beginning of list */
@@ -2034,12 +2020,12 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
if (addrlist->addr->ai_family == AF_INET) {
struct sockaddr_in *sin = (struct sockaddr_in *) socketaddr;
- PRMSG (4,"SocketINETConnect() sockname.sin_addr = %s\n",
+ 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)));
- PRMSG (4,"SocketINETConnect() sockname.sin_port = %d\n",
- ntohs(sin->sin_port), 0, 0);
+ prmsg (4,"SocketINETConnect() sockname.sin_port = %d\n",
+ ntohs(sin->sin_port));
if (Sockettrans2devtab[ciptr->index].family == AF_INET6) {
if (strcmp(Sockettrans2devtab[ciptr->index].transname,
@@ -2061,26 +2047,24 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
Sockettrans2devtab[newciptr->index].family !=
AF_INET) {
socketaddr = NULL;
- PRMSG (4,"SocketINETConnect() Cannot get IPv4 "
- " socketfor IPv4 address\n", 0,0,0);
+ prmsg (4,"SocketINETConnect() Cannot get IPv4 "
+ " socketfor IPv4 address\n");
}
if (newciptr)
free(newciptr);
} else {
socketaddr = NULL;
- PRMSG (4,"SocketINETConnect Skipping IPv4 address\n",
- 0,0,0);
+ prmsg (4,"SocketINETConnect Skipping IPv4 address\n");
}
}
} else if (addrlist->addr->ai_family == AF_INET6) {
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) socketaddr;
- PRMSG (4,"SocketINETConnect() sockname.sin6_addr = %s\n",
+ prmsg (4,"SocketINETConnect() sockname.sin6_addr = %s\n",
inet_ntop(addrlist->addr->ai_family,
- &sin6->sin6_addr,ntopbuf,sizeof(ntopbuf)),
- 0, 0);
- PRMSG (4,"SocketINETConnect() sockname.sin6_port = %d\n",
- ntohs(sin6->sin6_port), 0, 0);
+ &sin6->sin6_addr,ntopbuf,sizeof(ntopbuf)));
+ prmsg (4,"SocketINETConnect() sockname.sin6_port = %d\n",
+ ntohs(sin6->sin6_port));
if (Sockettrans2devtab[ciptr->index].family == AF_INET) {
if (strcmp(Sockettrans2devtab[ciptr->index].transname,
@@ -2099,8 +2083,8 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
Sockettrans2devtab[newciptr->index].family !=
AF_INET6) {
socketaddr = NULL;
- PRMSG (4,"SocketINETConnect() Cannot get IPv6 "
- "socket for IPv6 address\n", 0,0,0);
+ prmsg (4,"SocketINETConnect() Cannot get IPv6 "
+ "socket for IPv6 address\n");
}
if (newciptr)
free(newciptr);
@@ -2108,8 +2092,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
else
{
socketaddr = NULL;
- PRMSG (4,"SocketINETConnect() Skipping IPv6 address\n",
- 0,0,0);
+ prmsg (4,"SocketINETConnect() Skipping IPv6 address\n");
}
}
} else {
@@ -2147,17 +2130,17 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
tmpaddr = INADDR_NONE;
}
- PRMSG (4,"SocketINETConnect() inet_addr(%s) = %x\n", host, tmpaddr, 0);
+ prmsg (4,"SocketINETConnect() inet_addr(%s) = %x\n", host, tmpaddr);
if (tmpaddr == INADDR_NONE) {
if ((hostp = _XGethostbyname(host,hparams)) == NULL) {
- PRMSG (1,"SocketINETConnect: Can't get address for %s\n",
- host, 0, 0);
+ prmsg (1,"SocketINETConnect: Can't get address for %s\n",
+ host);
ESET(EINVAL);
return TRANS_CONNECT_FAILED;
}
if (hostp->h_addrtype != AF_INET) { /* is IP host? */
- PRMSG (1,"SocketINETConnect: not INET host%s\n", host, 0, 0);
+ prmsg (1,"SocketINETConnect: not INET host%s\n", host);
ESET(EPROTOTYPE);
return TRANS_CONNECT_FAILED;
}
@@ -2177,8 +2160,8 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
if (!is_numeric (port)) {
if ((servp = _XGetservbyname (port,"tcp",sparams)) == NULL) {
- PRMSG (1,"SocketINETConnect: can't get service for %s\n",
- port, 0, 0);
+ prmsg (1,"SocketINETConnect: can't get service for %s\n",
+ port);
return TRANS_CONNECT_FAILED;
}
sockname.sin_port = htons (servp->s_port);
@@ -2189,8 +2172,8 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
sockname.sin_port = htons (((unsigned short) tmpport));
}
- PRMSG (4,"SocketINETConnect: sockname.sin_port = %d\n",
- ntohs(sockname.sin_port), 0, 0);
+ prmsg (4,"SocketINETConnect: sockname.sin_port = %d\n",
+ ntohs(sockname.sin_port));
socketaddr = (struct sockaddr *) &sockname;
socketaddrlen = sizeof(sockname);
}
@@ -2259,8 +2242,8 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
res = TRANS_IN_PROGRESS;
else
{
- PRMSG (2,"SocketINETConnect: Can't connect: errno = %d\n",
- olderrno,0, 0);
+ prmsg (2,"SocketINETConnect: Can't connect: errno = %d\n",
+ olderrno);
res = TRANS_CONNECT_FAILED;
}
@@ -2274,17 +2257,15 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
if (TRANS(SocketINETGetAddr) (ciptr) < 0)
{
- PRMSG (1,
- "SocketINETConnect: ...SocketINETGetAddr() failed:\n",
- 0, 0, 0);
+ prmsg (1,
+ "SocketINETConnect: ...SocketINETGetAddr() failed:\n");
res = TRANS_CONNECT_FAILED;
}
else if (TRANS(SocketINETGetPeerAddr) (ciptr) < 0)
{
- PRMSG (1,
- "SocketINETConnect: ...SocketINETGetPeerAddr() failed:\n",
- 0, 0, 0);
+ prmsg (1,
+ "SocketINETConnect: ...SocketINETGetPeerAddr() failed:\n");
res = TRANS_CONNECT_FAILED;
}
}
@@ -2461,7 +2442,7 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
abstract = ciptr->transptr->flags & TRANS_ABSTRACT;
#endif
- PRMSG (2,"SocketUNIXConnect(%d,%s,%s)\n", ciptr->fd, host, port);
+ prmsg (2,"SocketUNIXConnect(%d,%s,%s)\n", ciptr->fd, host, port);
/*
* Make sure 'host' is really local. If not, we return failure.
@@ -2478,9 +2459,9 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
if (strcmp (host, "unix") != 0 && !UnixHostReallyLocal (host))
#endif
{
- PRMSG (1,
+ prmsg (1,
"SocketUNIXConnect: Cannot connect to non-local host %s\n",
- host, 0, 0);
+ host);
return TRANS_CONNECT_FAILED;
}
@@ -2491,8 +2472,7 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
if (!port || !*port)
{
- PRMSG (1,"SocketUNIXConnect: Missing port specification\n",
- 0, 0, 0);
+ prmsg (1,"SocketUNIXConnect: Missing port specification\n");
return TRANS_CONNECT_FAILED;
}
@@ -2507,7 +2487,7 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
#else
if (set_sun_path(port, UNIX_PATH, sockname.sun_path, abstract) != 0) {
#endif
- PRMSG (1, "SocketUNIXConnect: path too long\n", 0, 0, 0);
+ prmsg (1, "SocketUNIXConnect: path too long\n");
return TRANS_CONNECT_FAILED;
}
@@ -2578,8 +2558,8 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
} else {
return TRANS_CONNECT_FAILED;
} else {
- PRMSG (2,"SocketUNIXConnect: Can't connect: errno = %d\n",
- EGET(),0, 0);
+ prmsg (2,"SocketUNIXConnect: Can't connect: errno = %d\n",
+ EGET());
return TRANS_CONNECT_FAILED;
}
@@ -2600,9 +2580,8 @@ SocketUNIXConnectPost:
if ((ciptr->addr = (char *) malloc(namelen)) == NULL ||
(ciptr->peeraddr = (char *) malloc(namelen)) == NULL)
{
- PRMSG (1,
- "SocketUNIXCreateListener: Can't allocate space for the addr\n",
- 0, 0, 0);
+ prmsg (1,
+ "SocketUNIXCreateListener: Can't allocate space for the addr\n");
return TRANS_CONNECT_FAILED;
}
@@ -2627,7 +2606,7 @@ static int
TRANS(SocketBytesReadable) (XtransConnInfo ciptr, BytesReadable_t *pend)
{
- PRMSG (2,"SocketBytesReadable(%p,%d,%p)\n",
+ prmsg (2,"SocketBytesReadable(%p,%d,%p)\n",
ciptr, ciptr->fd, pend);
#if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT)
@@ -2704,7 +2683,7 @@ static int
TRANS(SocketRead) (XtransConnInfo ciptr, char *buf, int size)
{
- PRMSG (2,"SocketRead(%d,%p,%d)\n", ciptr->fd, buf, size);
+ prmsg (2,"SocketRead(%d,%p,%d)\n", ciptr->fd, buf, size);
#if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT)
@@ -2761,7 +2740,7 @@ static int
TRANS(SocketWrite) (XtransConnInfo ciptr, char *buf, int size)
{
- PRMSG (2,"SocketWrite(%d,%p,%d)\n", ciptr->fd, buf, size);
+ prmsg (2,"SocketWrite(%d,%p,%d)\n", ciptr->fd, buf, size);
#if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT)
@@ -2818,7 +2797,7 @@ static int
TRANS(SocketReadv) (XtransConnInfo ciptr, struct iovec *buf, int size)
{
- PRMSG (2,"SocketReadv(%d,%p,%d)\n", ciptr->fd, buf, size);
+ prmsg (2,"SocketReadv(%d,%p,%d)\n", ciptr->fd, buf, size);
#if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT)
@@ -2849,7 +2828,7 @@ static int
TRANS(SocketWritev) (XtransConnInfo ciptr, struct iovec *buf, int size)
{
- PRMSG (2,"SocketWritev(%d,%p,%d)\n", ciptr->fd, buf, size);
+ prmsg (2,"SocketWritev(%d,%p,%d)\n", ciptr->fd, buf, size);
#if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT)
@@ -2880,7 +2859,7 @@ static int
TRANS(SocketDisconnect) (XtransConnInfo ciptr)
{
- PRMSG (2,"SocketDisconnect(%p,%d)\n", ciptr, ciptr->fd, 0);
+ prmsg (2,"SocketDisconnect(%p,%d)\n", ciptr, ciptr->fd);
#ifdef WIN32
{
@@ -2899,7 +2878,7 @@ static int
TRANS(SocketINETClose) (XtransConnInfo ciptr)
{
- PRMSG (2,"SocketINETClose(%p,%d)\n", ciptr, ciptr->fd, 0);
+ prmsg (2,"SocketINETClose(%p,%d)\n", ciptr, ciptr->fd);
#ifdef WIN32
{
@@ -2927,7 +2906,7 @@ TRANS(SocketUNIXClose) (XtransConnInfo ciptr)
struct sockaddr_un *sockname = (struct sockaddr_un *) ciptr->addr;
int ret;
- PRMSG (2,"SocketUNIXClose(%x,%d)\n", ciptr, ciptr->fd, 0);
+ prmsg (2,"SocketUNIXClose(%x,%d)\n", ciptr, ciptr->fd);
#if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT)
@@ -2977,8 +2956,8 @@ TRANS(SocketUNIXCloseForCloning) (XtransConnInfo ciptr)
int ret;
- PRMSG (2,"SocketUNIXCloseForCloning(%p,%d)\n",
- ciptr, ciptr->fd, 0);
+ prmsg (2,"SocketUNIXCloseForCloning(%p,%d)\n",
+ ciptr, ciptr->fd);
#if defined(NX_TRANS_SOCKET) && defined(TRANS_CLIENT)
@@ -3254,7 +3233,7 @@ static char *_NXGetUnixDir(char *dir)
{
const char *tempDir;
- PRMSG (3, "_NXGetUnixDir(%s)\n", dir, 0, 0);
+ prmsg (3, "_NXGetUnixDir(%s)\n", dir);
if (strcmp(dir, UNIX_DIR) != 0)
{
@@ -3323,7 +3302,7 @@ static char *_NXGetUnixPath(char *path)
{
const char *unixDir;
- PRMSG (3, "_NXGetUnixPath(%s)\n", path, 0, 0);
+ prmsg (3, "_NXGetUnixPath(%s)\n", path);
if (strcmp(path, UNIX_PATH) != 0)
{
diff --git a/nx-X11/lib/xtrans/Xtransutil.c b/nx-X11/lib/xtrans/Xtransutil.c
index 92840eda4..96be48fba 100644
--- a/nx-X11/lib/xtrans/Xtransutil.c
+++ b/nx-X11/lib/xtrans/Xtransutil.c
@@ -87,7 +87,7 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp)
{
- PRMSG(2,"ConvertAddress(%d,%d,%x)\n",*familyp,*addrlenp,*addrp);
+ prmsg(2,"ConvertAddress(%d,%d,%x)\n",*familyp,*addrlenp,*addrp);
switch( *familyp )
{
@@ -174,8 +174,8 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp)
#endif
default:
- PRMSG(1,"ConvertAddress: Unknown family type %d\n",
- *familyp, 0,0 );
+ prmsg(1,"ConvertAddress: Unknown family type %d\n",
+ *familyp);
return -1;
}
@@ -426,7 +426,7 @@ TRANS(WSAStartup) (void)
{
static WSADATA wsadata;
- PRMSG (2,"WSAStartup()\n", 0, 0, 0);
+ prmsg (2,"WSAStartup()\n");
if (!wsadata.wVersion && WSAStartup(0x0101, &wsadata))
return 1;
@@ -474,8 +474,8 @@ trans_mkdir(char *path, int mode)
if (lstat(path, &buf) != 0) {
if (errno != ENOENT) {
- PRMSG(1, "mkdir: ERROR: (l)stat failed for %s (%d)\n",
- path, errno, 0);
+ prmsg(1, "mkdir: ERROR: (l)stat failed for %s (%d)\n",
+ path, errno);
return -1;
}
/* Dir doesn't exist. Try to create it */
@@ -488,15 +488,15 @@ trans_mkdir(char *path, int mode)
*/
if (geteuid() != 0) {
if (mode & 01000) {
- PRMSG(1, "mkdir: ERROR: euid != 0,"
+ prmsg(1, "mkdir: ERROR: euid != 0,"
"directory %s will not be created.\n",
- path, 0, 0);
+ path);
#ifdef FAIL_HARD
return -1;
#endif
} else {
- PRMSG(1, "mkdir: Cannot create %s with root ownership\n",
- path, 0, 0);
+ prmsg(1, "mkdir: Cannot create %s with root ownership\n",
+ path);
}
}
#endif
@@ -504,8 +504,8 @@ trans_mkdir(char *path, int mode)
#ifndef WIN32
if (mkdir(path, mode) == 0) {
if (chmod(path, mode)) {
- PRMSG(1, "mkdir: ERROR: Mode of %s should be set to %04o\n",
- path, mode, 0);
+ prmsg(1, "mkdir: ERROR: Mode of %s should be set to %04o\n",
+ path, mode);
#ifdef FAIL_HARD
return -1;
#endif
@@ -514,8 +514,8 @@ trans_mkdir(char *path, int mode)
if (mkdir(path) == 0) {
#endif
} else {
- PRMSG(1, "mkdir: ERROR: Cannot create %s\n",
- path, 0, 0);
+ prmsg(1, "mkdir: ERROR: Cannot create %s\n",
+ path);
return -1;
}
@@ -573,8 +573,8 @@ trans_mkdir(char *path, int mode)
struct stat fbuf;
if ((fd = open(path, O_RDONLY)) != -1) {
if (fstat(fd, &fbuf) == -1) {
- PRMSG(1, "mkdir: ERROR: fstat failed for %s (%d)\n",
- path, errno, 0);
+ prmsg(1, "mkdir: ERROR: fstat failed for %s (%d)\n",
+ path, errno);
return -1;
}
/*
@@ -584,8 +584,8 @@ trans_mkdir(char *path, int mode)
if (!S_ISDIR(fbuf.st_mode) ||
buf.st_dev != fbuf.st_dev ||
buf.st_ino != fbuf.st_ino) {
- PRMSG(1, "mkdir: ERROR: inode for %s changed\n",
- path, 0, 0);
+ prmsg(1, "mkdir: ERROR: inode for %s changed\n",
+ path);
return -1;
}
if (updateOwner && fchown(fd, 0, 0) == 0)
@@ -600,28 +600,27 @@ trans_mkdir(char *path, int mode)
if (updateOwner && !updatedOwner) {
#ifdef FAIL_HARD
if (status & FAIL_IF_NOT_ROOT) {
- PRMSG(1, "mkdir: ERROR: Owner of %s must be set to root\n",
- path, 0, 0);
+ prmsg(1, "mkdir: ERROR: Owner of %s must be set to root\n",
+ path);
return -1;
}
#endif
- PRMSG(1, "mkdir: Owner of %s should be set to root\n",
- path, 0, 0);
+ prmsg(1, "mkdir: Owner of %s should be set to root\n",
+ path);
}
if (updateMode && !updatedMode) {
#ifdef FAIL_HARD
if (status & FAIL_IF_NOMODE) {
- PRMSG(1, "mkdir: ERROR: Mode of %s must be set to %04o\n",
- path, mode, 0);
+ prmsg(1, "mkdir: ERROR: Mode of %s must be set to %04o\n",
+ path, mode);
return -1;
}
#endif
- PRMSG(1, "mkdir: Mode of %s should be set to %04o\n",
- path, mode, 0);
+ prmsg(1, "mkdir: Mode of %s should be set to %04o\n",
+ path, mode);
if (status & WARN_NO_ACCESS) {
- PRMSG(1, "mkdir: this may cause subsequent errors\n",
- 0, 0, 0);
+ prmsg(1, "mkdir: this may cause subsequent errors\n");
}
}
return 0;
diff --git a/nx-X11/lib/xtrans/transport.c b/nx-X11/lib/xtrans/transport.c
index fa91b4c52..6632a88fb 100644
--- a/nx-X11/lib/xtrans/transport.c
+++ b/nx-X11/lib/xtrans/transport.c
@@ -54,6 +54,9 @@ from The Open Group.
#include <stdlib.h>
#endif
+#define XTRANS_TRANSPORT_C /* used to flag Xtransint.h that it's being used
+ here, not just #included in another file */
+
#include "Xtransint.h"
#ifdef LOCALCONN