[PATCH] Use C99 varargs in PRMSG() macros
Tomas Carnecky
tom at dbservice.com
Wed Feb 4 06:34:45 PST 2009
Signed-off-by: Tomas Carnecky <tom at dbservice.com>
---
This patch doesn't fix any warnings. But now that I have spent
the time to write it, I thought I should submit it anyway.
Xtrans.c | 113 +++++++++++----------------
Xtransint.h | 31 ++++----
Xtranslcl.c | 248 +++++++++++++++++++++++++---------------------------------
Xtranssock.c | 204 +++++++++++++++++++-----------------------------
Xtranstli.c | 232 ++++++++++++++++++++----------------------------------
Xtransutil.c | 32 ++++----
6 files changed, 352 insertions(+), 508 deletions(-)
diff --git a/Xtrans.c b/Xtrans.c
index 278651a..8528459 100644
--- a/Xtrans.c
+++ b/Xtrans.c
@@ -134,7 +134,7 @@ void
TRANS(FreeConnInfo) (XtransConnInfo ciptr)
{
- PRMSG (3,"FreeConnInfo(%p)\n", ciptr, 0, 0);
+ PRMSG (3,"FreeConnInfo(%p)\n", ciptr);
if (ciptr->addr)
xfree (ciptr->addr);
@@ -158,7 +158,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
@@ -209,7 +209,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 */
@@ -422,12 +422,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
@@ -436,7 +436,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;
}
@@ -444,8 +444,7 @@ 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);
xfree (protocol);
xfree (host);
@@ -478,7 +477,7 @@ 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)
@@ -534,15 +533,14 @@ 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 *) xalloc (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;
}
@@ -560,12 +558,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;
}
@@ -591,7 +589,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);
}
@@ -604,7 +602,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);
}
@@ -617,7 +615,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);
}
@@ -630,7 +628,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);
}
@@ -785,8 +783,7 @@ 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;
}
@@ -819,7 +816,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);
@@ -843,12 +840,11 @@ 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;
}
@@ -858,8 +854,7 @@ TRANS(Connect) (XtransConnInfo ciptr, char *address)
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) xfree (protocol);
if (host) xfree (host);
return -1;
@@ -925,7 +920,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);
@@ -940,7 +935,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);
@@ -962,14 +957,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 *) xalloc (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);
@@ -982,14 +977,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 *) xalloc (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);
@@ -1059,7 +1054,7 @@ 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);
+ port ? port : "NULL", ciptrs_ret);
*count_ret = 0;
@@ -1085,17 +1080,15 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
snprintf(buffer, sizeof(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,
- "MakeAllCOTSServerListeners: failed to open listener for %s\n",
- trans->TransName, 0, 0);
+ PRMSG (1,"MakeAllCOTSServerListeners: failed to open listener for %s\n",
+ trans->TransName);
continue;
}
#if defined(IPv6) && defined(AF_INET6)
@@ -1114,9 +1107,7 @@ 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]);
@@ -1128,9 +1119,8 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
}
else
{
- PRMSG (1,
- "MakeAllCOTSServerListeners: failed to create listener for %s\n",
- trans->TransName, 0, 0);
+ PRMSG (1,"MakeAllCOTSServerListeners: failed to create listener for %s\n",
+ trans->TransName);
continue;
}
@@ -1141,9 +1131,8 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
ipv6_succ = 1;
#endif
- PRMSG (5,
- "MakeAllCOTSServerListeners: opened listener for %s, %d\n",
- trans->TransName, ciptr->fd, 0);
+ PRMSG (5,"MakeAllCOTSServerListeners: opened listener for %s, %d\n",
+ trans->TransName, ciptr->fd);
temp_ciptrs[*count_ret] = ciptr;
(*count_ret)++;
@@ -1151,8 +1140,7 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
*partial = (*count_ret < complete_network_count());
- PRMSG (5,
- "MakeAllCOTSServerListeners: partial=%d, actual=%d, complete=%d \n",
+ PRMSG (5,"MakeAllCOTSServerListeners: partial=%d, actual=%d, complete=%d \n",
*partial, *count_ret, complete_network_count());
if (*count_ret > 0)
@@ -1184,7 +1172,7 @@ TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
int status, i, j;
PRMSG (2,"MakeAllCLTSServerListeners(%s,%p)\n",
- port ? port : "NULL", ciptrs_ret, 0);
+ port ? port : "NULL", ciptrs_ret);
*count_ret = 0;
@@ -1198,14 +1186,12 @@ TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
snprintf(buffer, sizeof(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,
- "MakeAllCLTSServerListeners: failed to open listener for %s\n",
- trans->TransName, 0, 0);
+ PRMSG (1,"MakeAllCLTSServerListeners: failed to open listener for %s\n",
+ trans->TransName);
continue;
}
@@ -1219,9 +1205,7 @@ 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]);
@@ -1233,25 +1217,22 @@ TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
}
else
{
- PRMSG (1,
- "MakeAllCLTSServerListeners: failed to create listener for %s\n",
- trans->TransName, 0, 0);
+ PRMSG (1,"MakeAllCLTSServerListeners: failed to create listener for %s\n",
+ trans->TransName);
continue;
}
}
- PRMSG (5,
- "MakeAllCLTSServerListeners: opened listener for %s, %d\n",
- trans->TransName, ciptr->fd, 0);
+ PRMSG (5,"MakeAllCLTSServerListeners: opened listener for %s, %d\n",
+ trans->TransName, ciptr->fd);
temp_ciptrs[*count_ret] = ciptr;
(*count_ret)++;
}
*partial = (*count_ret < complete_network_count());
- PRMSG (5,
- "MakeAllCLTSServerListeners: partial=%d, actual=%d, complete=%d \n",
+ PRMSG (5,"MakeAllCLTSServerListeners: partial=%d, actual=%d, complete=%d \n",
*partial, *count_ret, complete_network_count());
if (*count_ret > 0)
diff --git a/Xtransint.h b/Xtransint.h
index e1a95a2..cec546a 100644
--- a/Xtransint.h
+++ b/Xtransint.h
@@ -350,28 +350,25 @@ static int TRANS(WriteV)(
*/
#if defined(XTRANSDEBUG)
-/* add hack to the format string to avoid warnings about extra arguments
- * to fprintf.
- */
#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; \
+#define PRMSG(lvl,...) if (lvl <= XTRANSDEBUG){ \
+ int saveerrno=errno; \
struct timeval tp;\
gettimeofday(&tp,0); \
ErrorF("%s",__xtransname); \
- ErrorF(x+hack,a,b,c); \
+ ErrorF(__VA_ARGS__); \
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; \
+#define PRMSG(lvl,...) if (lvl <= XTRANSDEBUG){ \
+ int 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, __VA_ARGS__); fflush(stderr); \
fprintf(stderr, "timestamp (ms): %d\n",tp.tv_sec*1000+tp.tv_usec/1000); \
fflush(stderr); \
errno=saveerrno; \
@@ -380,23 +377,23 @@ static int TRANS(WriteV)(
#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); \
+#define PRMSG(lvl,...) if (lvl <= XTRANSDEBUG){ \
+ int saveerrno=errno; \
+ ErrorF("%s",__xtransname); \
+ ErrorF(__VA_ARGS__); \
errno=saveerrno; \
} else ((void)0)
#else
-#define PRMSG(lvl,x,a,b,c) if (lvl <= XTRANSDEBUG){ \
- int hack= 0, saveerrno=errno; \
+#define PRMSG(lvl,...) if (lvl <= XTRANSDEBUG){ \
+ int saveerrno=errno; \
fprintf(stderr, "%s", __xtransname); fflush(stderr); \
- fprintf(stderr, x+hack,a,b,c); fflush(stderr); \
+ fprintf(stderr, __VA_ARGS__); fflush(stderr); \
errno=saveerrno; \
} else ((void)0)
#endif /* XSERV_t && TRANS_SERVER */
#endif /* XTRANSDEBUGTIMESTAMP */
#else
-#define PRMSG(lvl,x,a,b,c) ((void)0)
+#define PRMSG(lvl,...) ((void)0)
#endif /* XTRANSDEBUG */
#endif /* _XTRANSINT_H_ */
diff --git a/Xtranslcl.c b/Xtranslcl.c
index f6a2468..997358a 100644
--- a/Xtranslcl.c
+++ b/Xtranslcl.c
@@ -155,14 +155,14 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path)
if ((sunaddr = (struct sockaddr_un *) xalloc (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);
@@ -177,9 +177,7 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path)
if ((p_sunaddr = (struct sockaddr_un *) xalloc (
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");
xfree ((char *) sunaddr);
ciptr->addr = NULL;
@@ -189,7 +187,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);
@@ -319,10 +317,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 ) {
@@ -341,7 +339,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;
}
@@ -351,7 +349,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);
}
@@ -361,7 +359,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;
@@ -394,14 +392,13 @@ 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);
}
@@ -428,8 +425,7 @@ 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;
}
@@ -440,7 +436,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;
}
@@ -465,10 +461,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 ) {
@@ -488,7 +484,7 @@ TRANS(PTSOpenServer)(XtransConnInfo ciptr, char *port)
#endif
if (trans_mkdir(X_STREAMS_DIR, mode) == -1) {
PRMSG (1, "PTSOpenServer: mkdir(%s) failed, errno = %d\n",
- X_STREAMS_DIR, errno, 0);
+ X_STREAMS_DIR, errno);
return(-1);
}
@@ -499,8 +495,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);
}
@@ -511,7 +507,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);
}
@@ -519,25 +515,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);
}
@@ -550,7 +546,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;
}
@@ -570,17 +566,14 @@ 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,
- "PTSAccept: Error reading incoming connection. errno=%d \n",
- errno,0,0);
+ PRMSG(1,"PTSAccept: Error reading incoming connection. errno=%d \n",errno);
}
*status = TRANS_ACCEPT_MISC_ERROR;
return -1;
@@ -588,13 +581,12 @@ 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,
"PTSAccept: Error reading device name for new connection. errno=%d \n",
- errno,0,0);
+ errno);
}
*status = TRANS_ACCEPT_MISC_ERROR;
return -1;
@@ -603,7 +595,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;
}
@@ -616,8 +608,7 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
newciptr->addrlen=ciptr->addrlen;
if( (newciptr->addr=(char *)xalloc(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;
@@ -627,8 +618,7 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
newciptr->peeraddrlen=sizeof(struct sockaddr_un);
if( (sunaddr=(struct sockaddr_un *)xalloc(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");
xfree(newciptr->addr);
close(newfd);
*status = TRANS_ACCEPT_BAD_MALLOC;
@@ -671,10 +661,10 @@ TRANS(NAMEDOpenClient)(XtransConnInfo ciptr, char *port)
# endif
#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 ) {
@@ -688,18 +678,18 @@ TRANS(NAMEDOpenClient)(XtransConnInfo ciptr, char *port)
}
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 (fstat(fd, &filestat) < 0 ) {
- PRMSG(1,"NAMEDOpenClient: Cannot stat %s for NAMED connection\n", server_path, 0,0 );
+ PRMSG(1,"NAMEDOpenClient: Cannot stat %s for NAMED connection\n", server_path);
(void) close(fd);
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? */
(void) close(fd);
return -1;
@@ -707,7 +697,7 @@ TRANS(NAMEDOpenClient)(XtransConnInfo ciptr, char *port)
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;
}
@@ -718,8 +708,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;
}
@@ -739,7 +728,7 @@ TRANS(NAMEDOpenClient)(XtransConnInfo ciptr, char *port)
static int
TRANS(NAMEDOpenPipe)(const char *server_path)
{
- PRMSG(2,"NAMEDOpenPipe(%s)\n", server_path, 0,0 );
+ PRMSG(2,"NAMEDOpenPipe(%s)\n", server_path);
int fd, pipefd[2];
struct stat sbuf;
@@ -756,41 +745,41 @@ TRANS(NAMEDOpenPipe)(const char *server_path)
#endif
if (trans_mkdir(X_STREAMS_DIR, mode) == -1) {
PRMSG (1, "NAMEDOpenPipe: mkdir(%s) failed, errno = %d\n",
- X_STREAMS_DIR, errno, 0);
+ 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, "NAMEDOpenPipe: Can't open %s\n", server_path, 0,0 );
+ PRMSG(1, "NAMEDOpenPipe: Can't open %s\n", server_path);
return(-1);
}
close(fd);
if (chmod(server_path, (mode_t)0666) < 0) {
- PRMSG(1, "NAMEDOpenPipe: Can't open %s\n", server_path, 0,0 );
+ PRMSG(1, "NAMEDOpenPipe: Can't open %s\n", server_path);
return(-1);
}
} else {
- PRMSG(1, "NAMEDOpenPipe: stat on %s failed\n", server_path, 0,0 );
+ PRMSG(1, "NAMEDOpenPipe: stat on %s failed\n", server_path);
return(-1);
}
}
if( pipe(pipefd) != 0) {
- PRMSG(1, "NAMEDOpenPipe: pipe() failed, errno=%d\n",errno, 0,0 );
+ PRMSG(1, "NAMEDOpenPipe: pipe() failed, errno=%d\n",errno);
return(-1);
}
if( ioctl(pipefd[0], I_PUSH, "connld") != 0) {
- PRMSG(1, "NAMEDOpenPipe: ioctl(I_PUSH,\"connld\") failed, errno=%d\n",errno, 0,0 );
+ PRMSG(1, "NAMEDOpenPipe: 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, "NAMEDOpenPipe: fattach(%s) failed, errno=%d\n", server_path,errno, 0 );
+ PRMSG(1, "NAMEDOpenPipe: fattach(%s) failed, errno=%d\n", server_path,errno);
close(pipefd[0]);
close(pipefd[1]);
return(-1);
@@ -808,10 +797,10 @@ TRANS(NAMEDOpenServer)(XtransConnInfo ciptr, char *port)
char server_path[64];
#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 ) {
@@ -837,7 +826,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");
TRANS(LocalClose)(ciptr);
return -1;
}
@@ -855,7 +844,7 @@ TRANS(NAMEDResetListener) (XtransConnInfo ciptr)
struct sockaddr_un *sockname=(struct sockaddr_un *) ciptr->addr;
struct stat statb;
- PRMSG(2,"NAMEDResetListener(%p, %d)\n", ciptr, ciptr->fd, 0 );
+ PRMSG(2,"NAMEDResetListener(%p, %d)\n", ciptr, ciptr->fd);
if (ciptr->fd != -1) {
/*
@@ -864,7 +853,7 @@ TRANS(NAMEDResetListener) (XtransConnInfo ciptr)
if (stat (sockname->sun_path, &statb) == -1 ||
(statb.st_mode & S_IFMT) != S_IFIFO) {
- PRMSG(3, "Pipe %s trashed, recreating\n", sockname->sun_path, 0, 0);
+ PRMSG(3, "Pipe %s trashed, recreating\n", sockname->sun_path);
TRANS(LocalClose)(ciptr);
ciptr->fd = TRANS(NAMEDOpenPipe)(sockname->sun_path);
if (ciptr->fd >= 0)
@@ -882,10 +871,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);
}
@@ -896,9 +885,7 @@ TRANS(NAMEDAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
newciptr->family=ciptr->family;
newciptr->addrlen=ciptr->addrlen;
if( (newciptr->addr=(char *)xalloc(newciptr->addrlen)) == NULL ) {
- PRMSG(1,
- "NAMEDAccept: failed to allocate memory for pipe addr\n",
- 0,0,0);
+ PRMSG(1,"NAMEDAccept: failed to allocate memory for pipe addr\n");
close(str.fd);
*status = TRANS_ACCEPT_BAD_MALLOC;
return -1;
@@ -908,9 +895,7 @@ TRANS(NAMEDAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
newciptr->peeraddrlen=newciptr->addrlen;
if( (newciptr->peeraddr=(char *)xalloc(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");
xfree(newciptr->addr);
close(str.fd);
*status = TRANS_ACCEPT_BAD_MALLOC;
@@ -1027,18 +1012,18 @@ TRANS(SCOOpenClient)(XtransConnInfo ciptr, char *port)
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;
}
@@ -1058,7 +1043,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;
@@ -1082,7 +1067,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;
}
@@ -1108,12 +1093,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);
@@ -1125,19 +1110,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;
@@ -1146,7 +1131,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;
}
@@ -1159,22 +1144,21 @@ 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;
@@ -1188,7 +1172,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;
@@ -1205,22 +1189,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;
@@ -1232,9 +1216,7 @@ TRANS(SCOAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
newciptr->addrlen=ciptr->addrlen;
if( (newciptr->addr=(char *)xalloc(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;
@@ -1247,9 +1229,7 @@ TRANS(SCOAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
newciptr->peeraddrlen=newciptr->addrlen;
if( (newciptr->peeraddr=(char *)xalloc(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");
xfree(newciptr->addr);
close(fd);
*status = TRANS_ACCEPT_BAD_MALLOC;
@@ -1279,10 +1259,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 ) {
@@ -1297,8 +1277,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;
}
@@ -1319,10 +1298,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 ) {
@@ -1337,8 +1316,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;
}
@@ -1359,12 +1337,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);
@@ -1375,7 +1353,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;
}
@@ -1675,7 +1653,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") )
{
@@ -1697,7 +1675,7 @@ static void
TRANS(LocalEndTransports)(void)
{
- PRMSG(3,"LocalEndTransports()\n", 0,0,0 );
+ PRMSG(3,"LocalEndTransports()\n");
xfree(freeXLOCAL);
}
@@ -1712,7 +1690,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)
{
@@ -1792,7 +1770,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.
@@ -1804,9 +1782,7 @@ TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port)
if (strcmp (host, "unix") != 0 && !HostReallyLocal (host))
{
- PRMSG (1,
- "LocalOpenClient: Cannot connect to non-local host %s\n",
- host, 0, 0);
+ PRMSG (1,"LocalOpenClient: Cannot connect to non-local host %s\n",host);
return NULL;
}
@@ -1826,7 +1802,7 @@ TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port)
if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL )
{
PRMSG(1,"LocalOpenClient: calloc(1,%d) failed\n",
- sizeof(struct _XtransConnInfo),0,0 );
+ sizeof(struct _XtransConnInfo));
return NULL;
}
@@ -1848,14 +1824,10 @@ 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,
- "LocalOpenClient: Unknown Open type %d\n",
- type, 0,0 );
+ PRMSG(1,"LocalOpenClient: Unknown Open type %d\n",type);
}
if( ciptr->fd >= 0 )
break;
@@ -1901,7 +1873,7 @@ TRANS(LocalOpenServer)(int type, char *protocol, char *host, char *port)
if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL )
{
PRMSG(1,"LocalOpenServer: calloc(1,%d) failed\n",
- sizeof(struct _XtransConnInfo),0,0 );
+ sizeof(struct _XtransConnInfo));
return NULL;
}
@@ -1913,9 +1885,7 @@ 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);
@@ -1924,8 +1894,7 @@ 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];
@@ -1956,7 +1925,7 @@ TRANS(LocalReopenServer)(int type, int index, int fd, char *port)
if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL )
{
PRMSG(1,"LocalReopenServer: calloc(1,%d) failed\n",
- sizeof(struct _XtransConnInfo),0,0 );
+ sizeof(struct _XtransConnInfo));
return NULL;
}
@@ -1971,8 +1940,7 @@ 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 ) {
@@ -2042,7 +2010,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;
}
@@ -2091,7 +2059,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++)
{
@@ -2115,7 +2083,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++)
{
@@ -2164,7 +2132,7 @@ TRANS(LocalResetListener)(XtransConnInfo ciptr)
{
LOCALtrans2dev *transptr;
- PRMSG(2,"LocalResetListener(%x)\n",ciptr,0,0);
+ PRMSG(2,"LocalResetListener(%x)\n",ciptr);
transptr=(LOCALtrans2dev *)ciptr->priv;
if (transptr->devreset != NULL) {
@@ -2181,14 +2149,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)xcalloc(1,sizeof(struct _XtransConnInfo)))==NULL )
{
PRMSG(1,"LocalAccept: calloc(1,%d) failed\n",
- sizeof(struct _XtransConnInfo),0,0 );
+ sizeof(struct _XtransConnInfo));
*status = TRANS_ACCEPT_BAD_MALLOC;
return NULL;
}
@@ -2279,7 +2247,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;
}
@@ -2291,7 +2259,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);
@@ -2313,7 +2281,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/Xtranssock.c b/Xtranssock.c
index eabb587..2d46075 100644
--- a/Xtranssock.c
+++ b/Xtranssock.c
@@ -251,7 +251,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++)
{
@@ -279,7 +279,7 @@ TRANS(SocketINETGetAddr) (XtransConnInfo ciptr)
void *socknamePtr;
SOCKLEN_T namelen;
- PRMSG (3,"SocketINETGetAddr(%p)\n", ciptr, 0, 0);
+ PRMSG (3,"SocketINETGetAddr(%p)\n", ciptr);
#if defined(IPv6) && defined(AF_INET6)
if (haveIPv6)
@@ -302,8 +302,7 @@ 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;
}
@@ -313,9 +312,7 @@ TRANS(SocketINETGetAddr) (XtransConnInfo ciptr)
if ((ciptr->addr = (char *) xalloc (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;
}
@@ -367,7 +364,7 @@ TRANS(SocketINETGetPeerAddr) (XtransConnInfo ciptr)
bzero(socknamePtr, namelen);
- PRMSG (3,"SocketINETGetPeerAddr(%p)\n", ciptr, 0, 0);
+ PRMSG (3,"SocketINETGetPeerAddr(%p)\n", ciptr);
if (getpeername (ciptr->fd, (struct sockaddr *) socknamePtr,
(void *)&namelen) < 0)
@@ -375,8 +372,7 @@ 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;
}
@@ -386,9 +382,7 @@ TRANS(SocketINETGetPeerAddr) (XtransConnInfo ciptr)
if ((ciptr->peeraddr = (char *) xalloc (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;
}
@@ -405,7 +399,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)
@@ -418,7 +412,7 @@ TRANS(SocketOpen) (int i, int type)
if ((ciptr = (XtransConnInfo) xcalloc (
1, sizeof(struct _XtransConnInfo))) == NULL)
{
- PRMSG (1, "SocketOpen: malloc failed\n", 0, 0, 0);
+ PRMSG (1, "SocketOpen: malloc failed\n");
return NULL;
}
@@ -434,7 +428,7 @@ TRANS(SocketOpen) (int i, int type)
errno = WSAGetLastError();
#endif
PRMSG (2, "SocketOpen: socket() failed for %s\n",
- Sockettrans2devtab[i].transname, 0, 0);
+ Sockettrans2devtab[i].transname);
xfree ((char *) ciptr);
return NULL;
@@ -474,20 +468,20 @@ TRANS(SocketReopen) (int i, int type, int fd, char *port)
PRMSG (3,"SocketReopen(%d,%d,%s)\n", type, fd, port);
if (port == NULL) {
- PRMSG (1, "SocketReopen: port was null!\n", 0, 0, 0);
+ PRMSG (1, "SocketReopen: port was null!\n");
return NULL;
}
portlen = strlen(port) + 1; // include space for trailing null
#ifdef SOCK_MAXADDRLEN
if (portlen < 0 || portlen > (SOCK_MAXADDRLEN + 2)) {
- PRMSG (1, "SocketReopen: invalid portlen %d\n", portlen, 0, 0);
+ PRMSG (1, "SocketReopen: invalid portlen %d\n", portlen);
return NULL;
}
if (portlen < 14) portlen = 14;
#else
if (portlen < 0 || portlen > 14) {
- PRMSG (1, "SocketReopen: invalid portlen %d\n", portlen, 0, 0);
+ PRMSG (1, "SocketReopen: invalid portlen %d\n", portlen);
return NULL;
}
#endif /*SOCK_MAXADDRLEN*/
@@ -495,21 +489,21 @@ TRANS(SocketReopen) (int i, int type, int fd, char *port)
if ((ciptr = (XtransConnInfo) xcalloc (
1, sizeof(struct _XtransConnInfo))) == NULL)
{
- PRMSG (1, "SocketReopen: malloc(ciptr) failed\n", 0, 0, 0);
+ PRMSG (1, "SocketReopen: malloc(ciptr) failed\n");
return NULL;
}
ciptr->fd = fd;
if ((addr = (struct sockaddr *) xcalloc (1, portlen + 2)) == NULL) {
- PRMSG (1, "SocketReopen: malloc(addr) failed\n", 0, 0, 0);
+ PRMSG (1, "SocketReopen: malloc(addr) failed\n");
return NULL;
}
ciptr->addr = (char *) addr;
ciptr->addrlen = portlen + 2;
if ((ciptr->peeraddr = (char *) xcalloc (1, portlen + 2)) == NULL) {
- PRMSG (1, "SocketReopen: malloc(portaddr) failed\n", 0, 0, 0);
+ PRMSG (1, "SocketReopen: malloc(portaddr) failed\n");
return NULL;
}
ciptr->peeraddrlen = portlen + 2;
@@ -565,10 +559,10 @@ 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);
+ transname);
else
PRMSG (1,"SocketOpenCOTSClient: Unable to determine socket type for %s\n",
- transname, 0, 0);
+ transname);
return NULL;
}
@@ -609,10 +603,10 @@ 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);
+ thistrans->TransName);
else
PRMSG (1,"SocketOpenCOTSServer: Unable to determine socket type for %s\n",
- thistrans->TransName, 0, 0);
+ thistrans->TransName);
return NULL;
}
@@ -676,10 +670,10 @@ 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);
+ thistrans->TransName);
else
PRMSG (1,"SocketOpenCLTSClient: Unable to determine socket type for %s\n",
- thistrans->TransName, 0, 0);
+ thistrans->TransName);
return NULL;
}
@@ -715,10 +709,10 @@ 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);
+ thistrans->TransName);
else
PRMSG (1,"SocketOpenCLTSServer: Unable to determine socket type for %s\n",
- thistrans->TransName, 0, 0);
+ thistrans->TransName);
return NULL;
}
@@ -748,8 +742,7 @@ 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();
@@ -761,10 +754,10 @@ 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);
+ thistrans->TransName);
else
PRMSG (1,"SocketReopenCOTSServer: Unable to determine socket type for %s\n",
- thistrans->TransName, 0, 0);
+ thistrans->TransName);
return NULL;
}
@@ -783,7 +776,7 @@ TRANS(SocketReopenCLTSServer) (Xtransport *thistrans, int fd, char *port)
int i = -1;
PRMSG (2,
- "SocketReopenCLTSServer(%d, %s)\n", fd, port, 0);
+ "SocketReopenCLTSServer(%d, %s)\n", fd, port);
SocketInitOnce();
@@ -795,10 +788,10 @@ 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);
+ thistrans->TransName);
else
PRMSG (1,"SocketReopenCLTSServer: Unable to determine socket type for %s\n",
- thistrans->TransName, 0, 0);
+ thistrans->TransName);
return NULL;
}
@@ -861,7 +854,7 @@ TRANS(SocketCreateListener) (XtransConnInfo ciptr,
int fd = ciptr->fd;
int retry;
- PRMSG (3, "SocketCreateListener(%x,%p)\n", ciptr, fd, 0);
+ PRMSG (3, "SocketCreateListener(%p,%d)\n", ciptr, fd);
if (Sockettrans2devtab[ciptr->index].family == AF_INET
#if defined(IPv6) && defined(AF_INET6)
@@ -882,8 +875,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;
}
@@ -914,7 +906,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;
}
@@ -949,7 +941,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
/*
@@ -980,7 +972,7 @@ TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, char *port, unsigned int
{
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 */
@@ -1035,17 +1027,13 @@ 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;
}
@@ -1075,7 +1063,7 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port,
#endif
PRMSG (2, "SocketUNIXCreateListener(%s)\n",
- port ? port : "NULL", 0, 0);
+ port ? port : "NULL");
/* Make sure the directory is created */
@@ -1089,7 +1077,7 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port,
#endif
if (!abstract && trans_mkdir(UNIX_DIR, mode) == -1) {
PRMSG (1, "SocketUNIXCreateListener: mkdir(%s) failed, errno = %d\n",
- UNIX_DIR, errno, 0);
+ UNIX_DIR, errno);
(void) umask (oldUmask);
return TRANS_CREATE_LISTENER_FAILED;
}
@@ -1103,7 +1091,7 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port,
port = tmpport;
}
if (set_sun_path(port, UNIX_PATH, sockname.sun_path, abstract) != 0) {
- PRMSG (1, "SocketUNIXCreateListener: path too long\n", 0, 0, 0);
+ PRMSG (1, "SocketUNIXCreateListener: path too long\n");
return TRANS_CREATE_LISTENER_FAILED;
}
@@ -1127,9 +1115,7 @@ 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;
}
@@ -1145,9 +1131,7 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port,
if ((ciptr->addr = (char *) xalloc (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;
}
@@ -1182,7 +1166,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 ||
@@ -1204,7 +1188,7 @@ TRANS(SocketUNIXResetListener) (XtransConnInfo ciptr)
#endif
if (trans_mkdir(UNIX_DIR, mode) == -1) {
PRMSG (1, "SocketUNIXResetListener: mkdir(%s) failed, errno = %d\n",
- UNIX_DIR, errno, 0);
+ UNIX_DIR, errno);
(void) umask (oldUmask);
return TRANS_RESET_FAILURE;
}
@@ -1256,12 +1240,12 @@ TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status)
struct sockaddr_in sockname;
SOCKLEN_T 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) xcalloc (
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;
}
@@ -1272,7 +1256,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");
xfree (newciptr);
*status = TRANS_ACCEPT_FAILED;
return NULL;
@@ -1297,9 +1281,7 @@ 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);
xfree (newciptr);
*status = TRANS_ACCEPT_MISC_ERROR;
@@ -1308,9 +1290,7 @@ 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) xfree (newciptr->addr);
xfree (newciptr);
@@ -1335,12 +1315,12 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status)
struct sockaddr_un sockname;
SOCKLEN_T namelen = sizeof sockname;
- PRMSG (2, "SocketUNIXAccept(%p,%d)\n", ciptr, ciptr->fd, 0);
+ PRMSG (2, "SocketUNIXAccept(%p,%d)\n", ciptr, ciptr->fd);
if ((newciptr = (XtransConnInfo) xcalloc (
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;
}
@@ -1348,7 +1328,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");
xfree (newciptr);
*status = TRANS_ACCEPT_FAILED;
return NULL;
@@ -1362,9 +1342,7 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status)
if ((newciptr->addr = (char *) xalloc (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);
xfree (newciptr);
*status = TRANS_ACCEPT_BAD_MALLOC;
@@ -1381,9 +1359,7 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status)
if ((newciptr->peeraddr = (char *) xalloc (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) xfree (newciptr->addr);
xfree (newciptr);
@@ -1508,7 +1484,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;
}
@@ -1518,7 +1494,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
if (resetonce) {
/* Already checked entire list - no usable addresses */
PRMSG (1, "SocketINETConnect() no usable address "
- "for %s:%s\n", host, port, 0);
+ "for %s:%s\n", host, port);
return TRANS_CONNECT_FAILED;
} else {
/* Go back to beginning of list */
@@ -1535,10 +1511,10 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
PRMSG (4,"SocketINETConnect() sockname.sin_addr = %s\n",
inet_ntop(addrlist->addr->ai_family,&sin->sin_addr,
- ntopbuf,sizeof(ntopbuf)), 0, 0);
+ ntopbuf,sizeof(ntopbuf)));
PRMSG (4,"SocketINETConnect() sockname.sin_port = %d\n",
- ntohs(sin->sin_port), 0, 0);
+ ntohs(sin->sin_port));
if (Sockettrans2devtab[ciptr->index].family == AF_INET6) {
if (strcmp(Sockettrans2devtab[ciptr->index].transname,
@@ -1561,14 +1537,13 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
AF_INET) {
socketaddr = NULL;
PRMSG (4,"SocketINETConnect() Cannot get IPv4 "
- " socketfor IPv4 address\n", 0,0,0);
+ " socketfor IPv4 address\n");
}
if (newciptr)
xfree(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) {
@@ -1576,10 +1551,9 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
PRMSG (4,"SocketINETConnect() sockname.sin6_addr = %s\n",
inet_ntop(addrlist->addr->ai_family,
- &sin6->sin6_addr,ntopbuf,sizeof(ntopbuf)),
- 0, 0);
+ &sin6->sin6_addr,ntopbuf,sizeof(ntopbuf)));
PRMSG (4,"SocketINETConnect() sockname.sin6_port = %d\n",
- ntohs(sin6->sin6_port), 0, 0);
+ ntohs(sin6->sin6_port));
if (Sockettrans2devtab[ciptr->index].family == AF_INET) {
if (strcmp(Sockettrans2devtab[ciptr->index].transname,
@@ -1599,7 +1573,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
AF_INET6) {
socketaddr = NULL;
PRMSG (4,"SocketINETConnect() Cannot get IPv6 "
- "socket for IPv6 address\n", 0,0,0);
+ "socket for IPv6 address\n");
}
if (newciptr)
xfree(newciptr);
@@ -1607,8 +1581,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 {
@@ -1646,17 +1619,16 @@ 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;
}
@@ -1676,8 +1648,7 @@ 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);
@@ -1689,7 +1660,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
}
PRMSG (4,"SocketINETConnect: sockname.sin_port = %d\n",
- ntohs(sockname.sin_port), 0, 0);
+ ntohs(sockname.sin_port));
socketaddr = (struct sockaddr *) &sockname;
socketaddrlen = sizeof(sockname);
}
@@ -1758,9 +1729,7 @@ 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;
}
} else {
@@ -1773,17 +1742,13 @@ 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;
}
}
@@ -1972,9 +1937,7 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
if (host && *host && host[0]!='/' && strcmp (host, "unix") != 0 && !UnixHostReallyLocal (host))
{
- PRMSG (1,
- "SocketUNIXConnect: Cannot connect to non-local host %s\n",
- host, 0, 0);
+ PRMSG (1,"SocketUNIXConnect: Cannot connect to non-local host %s\n",host);
return TRANS_CONNECT_FAILED;
}
@@ -1985,8 +1948,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;
}
@@ -1997,7 +1959,7 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
sockname.sun_family = AF_UNIX;
if (set_sun_path(port, UNIX_PATH, sockname.sun_path, abstract) != 0) {
- PRMSG (1, "SocketUNIXConnect: path too long\n", 0, 0, 0);
+ PRMSG (1, "SocketUNIXConnect: path too long\n");
return TRANS_CONNECT_FAILED;
}
@@ -2064,9 +2026,7 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
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;
}
}
@@ -2080,9 +2040,7 @@ TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port)
if ((ciptr->addr = (char *) xalloc(namelen)) == NULL ||
(ciptr->peeraddr = (char *) xalloc(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;
}
@@ -2189,7 +2147,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
{
@@ -2208,7 +2166,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
{
@@ -2236,7 +2194,7 @@ TRANS(SocketUNIXClose) (XtransConnInfo ciptr)
struct sockaddr_un *sockname = (struct sockaddr_un *) ciptr->addr;
int ret;
- PRMSG (2,"SocketUNIXClose(%p,%d)\n", ciptr, ciptr->fd, 0);
+ PRMSG (2,"SocketUNIXClose(%p,%d)\n", ciptr, ciptr->fd);
ret = close(ciptr->fd);
@@ -2264,7 +2222,7 @@ TRANS(SocketUNIXCloseForCloning) (XtransConnInfo ciptr)
int ret;
PRMSG (2,"SocketUNIXCloseForCloning(%p,%d)\n",
- ciptr, ciptr->fd, 0);
+ ciptr, ciptr->fd);
ret = close(ciptr->fd);
diff --git a/Xtranstli.c b/Xtranstli.c
index a9dfc21..f7c8fc3 100644
--- a/Xtranstli.c
+++ b/Xtranstli.c
@@ -123,7 +123,7 @@ TRANS(TLISelectFamily)(char *family)
{
int i;
- PRMSG(3,"TLISelectFamily(%s)\n", family, 0,0 );
+ PRMSG(3,"TLISelectFamily(%s)\n", family);
for(i=0;i<NUMTLIFAMILIES;i++)
{
@@ -146,7 +146,7 @@ TRANS(TLIGetAddr)(XtransConnInfo ciptr)
Xtransaddr sockname;
struct netbuf netbuf;
- PRMSG(3,"TLIGetAddr(%x)\n", ciptr, 0,0 );
+ PRMSG(3,"TLIGetAddr(%x)\n", ciptr);
netbuf.buf=(char *)&sockname;
netbuf.len=sizeof(sockname);
@@ -154,13 +154,12 @@ TRANS(TLIGetAddr)(XtransConnInfo ciptr)
if( t_getname(ciptr->fd,&netbuf,LOCALNAME) < 0 )
{
- PRMSG(1,"TLIGetAddr: t_getname(LOCALNAME) failed: %d\n",
- errno, 0,0 );
+ PRMSG(1,"TLIGetAddr: t_getname(LOCALNAME) failed: %d\n",errno);
return -1;
}
PRMSG(4,"TLIGetAddr: got family %d len %d\n",
- ((struct sockaddr *) &sockname)->sa_family ,netbuf.len, 0 );
+ ((struct sockaddr *) &sockname)->sa_family ,netbuf.len);
/*
* Everything looks good: fill in the XtransConnInfo structure.
@@ -171,8 +170,7 @@ TRANS(TLIGetAddr)(XtransConnInfo ciptr)
if( (ciptr->addr=(char *)xalloc(netbuf.len)) == NULL )
{
- PRMSG(1, "TLIGetAddr: Can't allocate space for the addr\n",
- 0,0,0);
+ PRMSG(1, "TLIGetAddr: Can't allocate space for the addr\n");
return -1;
}
@@ -196,7 +194,7 @@ TRANS(TLIGetPeerAddr)(XtransConnInfo ciptr)
Xtransaddr sockname;
struct netbuf netbuf;
- PRMSG(3,"TLIGetPeerAddr(%x)\n", ciptr, 0,0 );
+ PRMSG(3,"TLIGetPeerAddr(%x)\n", ciptr);
netbuf.buf=(char *)&sockname;
netbuf.len=sizeof(sockname);
@@ -205,12 +203,12 @@ TRANS(TLIGetPeerAddr)(XtransConnInfo ciptr)
if( t_getname(ciptr->fd,&netbuf,REMOTENAME) < 0 )
{
PRMSG(1,"TLIGetPeerAddr: t_getname(REMOTENAME) failed: %d\n",
- errno, 0,0 );
+ errno);
return -1;
}
PRMSG(4,"TLIGetPeerAddr: got family %d len %d\n",
- ((struct sockaddr *) &sockname)->sa_family ,netbuf.len, 0 );
+ ((struct sockaddr *) &sockname)->sa_family ,netbuf.len);
/*
* Everything looks good: fill in the XtransConnInfo structure.
@@ -221,9 +219,7 @@ TRANS(TLIGetPeerAddr)(XtransConnInfo ciptr)
if( (ciptr->peeraddr=(char *)xalloc(netbuf.len)) == NULL )
{
- PRMSG(1,
- "TLIGetPeerAddr: Can't allocate space for the addr\n",
- 0,0,0);
+ PRMSG(1,"TLIGetPeerAddr: Can't allocate space for the addr\n");
return -1;
}
@@ -257,18 +253,14 @@ TRANS(TLITLIBindLocal)(int fd, int family, char *port)
{
if( (req=(struct t_bind *)t_alloc(fd,T_BIND,0)) == NULL )
{
- PRMSG(1,
- "TLITLIBindLocal() failed to allocate a t_bind\n",
- 0,0,0 );
+ PRMSG(1,"TLITLIBindLocal() failed to allocate a t_bind\n");
return -1;
}
if( (sunaddr=(struct sockaddr_un *)
malloc(sizeof(struct sockaddr_un))) == NULL )
{
- PRMSG(1,
- "TLITLIBindLocal: failed to allocate a sockaddr_un\n",
- 0,0,0 );
+ PRMSG(1,"TLITLIBindLocal: failed to allocate a sockaddr_un\n");
t_free((char *)req,T_BIND);
return -1;
}
@@ -286,8 +278,7 @@ TRANS(TLITLIBindLocal)(int fd, int family, char *port)
(void) sprintf(sunaddr->sun_path,"%s%d",
TLINODENAME, getpid()^time(NULL) );
- PRMSG(4, "TLITLIBindLocal: binding to %s\n",
- sunaddr->sun_path, 0,0);
+ PRMSG(4, "TLITLIBindLocal: binding to %s\n", sunaddr->sun_path);
req->addr.buf=(char *)sunaddr;
req->addr.len=sizeof(*sunaddr);
@@ -296,9 +287,7 @@ TRANS(TLITLIBindLocal)(int fd, int family, char *port)
if( t_bind(fd, req, NULL) < 0 )
{
- PRMSG(1,
- "TLIBindLocal: Unable to bind TLI device to %s\n",
- port, 0,0 );
+ PRMSG(1,"TLIBindLocal: Unable to bind TLI device to %s\n", port);
if (sunaddr)
free((char *) sunaddr);
if (req)
@@ -314,17 +303,17 @@ TRANS(TLIOpen)(char *device)
{
XtransConnInfo ciptr;
- PRMSG(3,"TLIOpen(%s)\n", device, 0,0 );
+ PRMSG(3,"TLIOpen(%s)\n", device);
if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL )
{
- PRMSG(1, "TLIOpen: calloc failed\n", 0,0,0 );
+ PRMSG(1, "TLIOpen: calloc failed\n");
return NULL;
}
if( (ciptr->fd=t_open( device, O_RDWR, NULL )) < 0 )
{
- PRMSG(1, "TLIOpen: t_open failed for %s\n", device, 0,0 );
+ PRMSG(1, "TLIOpen: t_open failed for %s\n", device);
free(ciptr);
return NULL;
}
@@ -345,13 +334,13 @@ TRANS(TLIReopen)(char *device, int fd, char *port)
if (t_sync (fd) < 0)
{
- PRMSG(1, "TLIReopen: t_sync failed\n", 0,0,0 );
+ PRMSG(1, "TLIReopen: t_sync failed\n");
return NULL;
}
if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL )
{
- PRMSG(1, "TLIReopen: calloc failed\n", 0,0,0 );
+ PRMSG(1, "TLIReopen: calloc failed\n");
return NULL;
}
@@ -401,9 +390,8 @@ TRANS(TLIAddrToNetbuf)(int tlifamily, char *host, char *port,
{
/* we have at least one address to use */
- PRMSG(5, "TLIAddrToNetbuf: found address for %s.%s\n", host, port, 0 );
- PRMSG(5, "TLIAddrToNetbuf: %s\n",taddr2uaddr(netconfigp,nd_addrlistp->n_addrs),
- 0,0 );
+ PRMSG(5, "TLIAddrToNetbuf: found address for %s.%s\n", host, port);
+ PRMSG(5, "TLIAddrToNetbuf: %s\n",taddr2uaddr(netconfigp,nd_addrlistp->n_addrs));
memcpy(netbufp->buf,nd_addrlistp->n_addrs->buf,
nd_addrlistp->n_addrs->len);
@@ -436,22 +424,20 @@ TRANS(TLIOpenCOTSClient)(Xtransport *thistrans, char *protocol,
if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 )
{
PRMSG(1,"TLIOpenCOTSClient: Unable to determine device for %s\n",
- thistrans->TransName, 0,0 );
+ thistrans->TransName);
return NULL;
}
if( (ciptr=TRANS(TLIOpen)(TLItrans2devtab[i].devcotsname)) == NULL )
{
PRMSG(1,"TLIOpenCOTSClient: Unable to open device for %s\n",
- thistrans->TransName, 0,0 );
+ thistrans->TransName);
return NULL;
}
if( TRANS(TLITLIBindLocal)(ciptr->fd,TLItrans2devtab[i].family,port) < 0 )
{
- PRMSG(1,
- "TLIOpenCOTSClient: ...TLITLIBindLocal() failed: %d\n",
- errno, 0,0 );
+ PRMSG(1,"TLIOpenCOTSClient: ...TLITLIBindLocal() failed: %d\n",errno);
t_close(ciptr->fd);
xfree(ciptr);
return NULL;
@@ -459,9 +445,7 @@ TRANS(TLIOpenCOTSClient)(Xtransport *thistrans, char *protocol,
if( TRANS(TLIGetAddr)(ciptr) < 0 )
{
- PRMSG(1,
- "TLIOpenCOTSClient: ...TLIGetAddr() failed: %d\n",
- errno, 0,0 );
+ PRMSG(1,"TLIOpenCOTSClient: ...TLIGetAddr() failed: %d\n",errno);
t_close(ciptr->fd);
xfree(ciptr);
return NULL;
@@ -490,17 +474,15 @@ TRANS(TLIOpenCOTSServer)(Xtransport *thistrans, char *protocol,
if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 )
{
- PRMSG(1,
- "TLIOpenCOTSServer: Unable to determine device for %s\n",
- thistrans->TransName, 0,0 );
+ PRMSG(1,"TLIOpenCOTSServer: Unable to determine device for %s\n",
+ thistrans->TransName);
return NULL;
}
if( (ciptr=TRANS(TLIOpen)(TLItrans2devtab[i].devcotsname)) == NULL )
{
- PRMSG(1,
- "TLIOpenCOTSServer: Unable to open device for %s\n",
- thistrans->TransName, 0,0 );
+ PRMSG(1,"TLIOpenCOTSServer: Unable to open device for %s\n",
+ thistrans->TransName);
return NULL;
}
@@ -533,25 +515,21 @@ TRANS(TLIOpenCLTSClient)(Xtransport *thistrans, char *protocol,
if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 )
{
- PRMSG(1,
- "TLIOpenCLTSClient: Unable to determine device for %s\n",
- thistrans->TransName, 0,0 );
+ PRMSG(1,"TLIOpenCLTSClient: Unable to determine device for %s\n",
+ thistrans->TransName);
return NULL;
}
if( (ciptr=TRANS(TLIOpen)(TLItrans2devtab[i].devcltsname)) == NULL )
{
- PRMSG(1,
- "TLIOpenCLTSClient: Unable to open device for %s\n",
- thistrans->TransName, 0,0 );
+ PRMSG(1,"TLIOpenCLTSClient: Unable to open device for %s\n",
+ thistrans->TransName);
return NULL;
}
if( TRANS(TLITLIBindLocal)(ciptr->fd,TLItrans2devtab[i].family,port) < 0 )
{
- PRMSG(1,
- "TLIOpenCLTSClient: ...TLITLIBindLocal() failed: %d\n",
- errno, 0,0 );
+ PRMSG(1,"TLIOpenCLTSClient: ...TLITLIBindLocal() failed: %d\n",errno);
t_close(ciptr->fd);
xfree(ciptr);
return NULL;
@@ -559,9 +537,7 @@ TRANS(TLIOpenCLTSClient)(Xtransport *thistrans, char *protocol,
if( TRANS(TLIGetAddr)(ciptr) < 0 )
{
- PRMSG(1,
- "TLIOpenCLTSClient: ...TLIGetPeerAddr() failed: %d\n",
- errno, 0,0 );
+ PRMSG(1,"TLIOpenCLTSClient: ...TLIGetPeerAddr() failed: %d\n",errno);
t_close(ciptr->fd);
xfree(ciptr);
return NULL;
@@ -587,17 +563,15 @@ TRANS(TLIOpenCLTSServer)(Xtransport *thistrans, char *protocol,
if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 )
{
- PRMSG(1,
- "TLIOpenCLTSServer: Unable to determine device for %s\n",
- thistrans->TransName, 0,0 );
+ PRMSG(1,"TLIOpenCLTSServer: Unable to determine device for %s\n",
+ thistrans->TransName);
return NULL;
}
if( (ciptr=TRANS(TLIOpen)(TLItrans2devtab[i].devcltsname)) == NULL )
{
- PRMSG(1,
- "TLIOpenCLTSServer: Unable to open device for %s\n",
- thistrans->TransName, 0,0 );
+ PRMSG(1,"TLIOpenCLTSServer: Unable to open device for %s\n",
+ thistrans->TransName);
return NULL;
}
@@ -616,22 +590,20 @@ TRANS(TLIReopenCOTSServer)(Xtransport *thistrans, int fd, char *port)
XtransConnInfo ciptr;
int i;
- PRMSG(2,"TLIReopenCOTSServer(%d, %s)\n", fd, port, 0 );
+ PRMSG(2,"TLIReopenCOTSServer(%d, %s)\n", fd, port);
if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 )
{
- PRMSG(1,
- "TLIReopenCOTSServer: Unable to determine device for %s\n",
- thistrans->TransName, 0,0 );
+ PRMSG(1,"TLIReopenCOTSServer: Unable to determine device for %s\n",
+ thistrans->TransName);
return NULL;
}
if( (ciptr=TRANS(TLIReopen)(
TLItrans2devtab[i].devcotsname, fd, port)) == NULL )
{
- PRMSG(1,
- "TLIReopenCOTSServer: Unable to open device for %s\n",
- thistrans->TransName, 0,0 );
+ PRMSG(1,"TLIReopenCOTSServer: Unable to open device for %s\n",
+ thistrans->TransName);
return NULL;
}
@@ -650,22 +622,20 @@ TRANS(TLIReopenCLTSServer)(Xtransport *thistrans, int fd, char *port)
XtransConnInfo ciptr;
int i;
- PRMSG(2,"TLIReopenCLTSServer(%d, %s)\n", fd, port, 0 );
+ PRMSG(2,"TLIReopenCLTSServer(%d, %s)\n", fd, port);
if( (i=TRANS(TLISelectFamily)(thistrans->TransName)) < 0 )
{
- PRMSG(1,
- "TLIReopenCLTSServer: Unable to determine device for %s\n",
- thistrans->TransName, 0,0 );
+ PRMSG(1,"TLIReopenCLTSServer: Unable to determine device for %s\n",
+ thistrans->TransName);
return NULL;
}
if( (ciptr=TRANS(TLIReopen)(
TLItrans2devtab[i].devcltsname, fd, port)) == NULL )
{
- PRMSG(1,
- "TLIReopenCLTSServer: Unable to open device for %s\n",
- thistrans->TransName, 0,0 );
+ PRMSG(1,"TLIReopenCLTSServer: Unable to open device for %s\n",
+ thistrans->TransName);
return NULL;
}
@@ -699,15 +669,14 @@ TRANS(TLICreateListener)(XtransConnInfo ciptr, struct t_bind *req)
if( (ret=(struct t_bind *)t_alloc(ciptr->fd,T_BIND,T_ALL)) == NULL )
{
- PRMSG(1, "TLICreateListener: failed to allocate a t_bind\n",
- 0,0,0 );
+ PRMSG(1, "TLICreateListener: failed to allocate a t_bind\n");
t_free((char *)req,T_BIND);
return TRANS_CREATE_LISTENER_FAILED;
}
if( t_bind(ciptr->fd, req, ret) < 0 )
{
- PRMSG(1, "TLICreateListener: t_bind failed\n", 0,0,0 );
+ PRMSG(1, "TLICreateListener: t_bind failed\n");
t_free((char *)req,T_BIND);
t_free((char *)ret,T_BIND);
return TRANS_CREATE_LISTENER_FAILED;
@@ -715,8 +684,7 @@ TRANS(TLICreateListener)(XtransConnInfo ciptr, struct t_bind *req)
if( memcmp(req->addr.buf,ret->addr.buf,req->addr.len) != 0 )
{
- PRMSG(1, "TLICreateListener: unable to bind to %x\n",
- req, 0,0 );
+ PRMSG(1, "TLICreateListener: unable to bind to %x\n", req);
t_free((char *)req,T_BIND);
t_free((char *)ret,T_BIND);
return TRANS_ADDR_IN_USE;
@@ -728,9 +696,7 @@ TRANS(TLICreateListener)(XtransConnInfo ciptr, struct t_bind *req)
if( (ciptr->addr=(char *)xalloc(ret->addr.len)) == NULL )
{
- PRMSG(1,
- "TLICreateListener: Unable to allocate space for the address\n",
- 0,0,0 );
+ PRMSG(1,"TLICreateListener: Unable to allocate space for the address\n");
t_free((char *)req,T_BIND);
t_free((char *)ret, T_BIND);
return TRANS_CREATE_LISTENER_FAILED;
@@ -778,18 +744,15 @@ TRANS(TLIINETCreateListener)(XtransConnInfo ciptr, char *port, unsigned int flag
if( (req=(struct t_bind *)t_alloc(ciptr->fd,T_BIND,T_ALL)) == NULL )
{
- PRMSG(1,
- "TLIINETCreateListener: failed to allocate a t_bind\n",
- 0,0,0 );
+ PRMSG(1,"TLIINETCreateListener: failed to allocate a t_bind\n");
return TRANS_CREATE_LISTENER_FAILED;
}
if( port && *port ) {
if(TRANS(TLIAddrToNetbuf)(ciptr->index,HOST_SELF,port,&(req->addr)) < 0)
{
- PRMSG(1,
- "TLIINETCreateListener: can't resolve name:HOST_SELF.%s\n",
- port, 0,0 );
+ PRMSG(1,"TLIINETCreateListener: can't resolve name:HOST_SELF.%s\n",
+ port);
t_free((char *)req,T_BIND);
return TRANS_CREATE_LISTENER_FAILED;
}
@@ -821,18 +784,14 @@ TRANS(TLITLICreateListener)(XtransConnInfo ciptr, char *port, unsigned int flags
if( (req=(struct t_bind *)t_alloc(ciptr->fd,T_BIND,0)) == NULL )
{
- PRMSG(1,
- "TLITLICreateListener: failed to allocate a t_bind\n",
- 0,0,0 );
+ PRMSG(1,"TLITLICreateListener: failed to allocate a t_bind\n");
return TRANS_CREATE_LISTENER_FAILED;
}
if( (sunaddr=(struct sockaddr_un *)
malloc(sizeof(struct sockaddr_un))) == NULL )
{
- PRMSG(1,
- "TLITLICreateListener: failed to allocate a sockaddr_un\n",
- 0,0,0 );
+ PRMSG(1,"TLITLICreateListener: failed to allocate a sockaddr_un\n");
t_free((char *)req,T_BIND);
return TRANS_CREATE_LISTENER_FAILED;
}
@@ -872,11 +831,11 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
XtransConnInfo newciptr;
int i;
- PRMSG(2,"TLIAccept(%x->%d)\n", ciptr, ciptr->fd, 0 );
+ PRMSG(2,"TLIAccept(%x->%d)\n", ciptr, ciptr->fd);
if( (call=(struct t_call *)t_alloc(ciptr->fd,T_CALL,T_ALL)) == NULL )
{
- PRMSG(1, "TLIAccept() failed to allocate a t_call\n", 0,0,0 );
+ PRMSG(1, "TLIAccept() failed to allocate a t_call\n");
*status = TRANS_ACCEPT_BAD_MALLOC;
return NULL;
}
@@ -885,8 +844,8 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
{
extern char *t_errlist[];
extern int t_errno;
- PRMSG(1, "TLIAccept() t_listen() failed\n", 0,0,0 );
- PRMSG(1, "TLIAccept: %s\n", t_errlist[t_errno], 0,0 );
+ PRMSG(1, "TLIAccept() t_listen() failed\n");
+ PRMSG(1, "TLIAccept: %s\n", t_errlist[t_errno]);
t_free((char *)call,T_CALL);
*status = TRANS_ACCEPT_MISC_ERROR;
return NULL;
@@ -900,7 +859,7 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
if( (newciptr=TRANS(TLIOpen)(TLItrans2devtab[i].devcotsname)) == NULL )
{
- PRMSG(1, "TLIAccept() failed to open a new endpoint\n", 0,0,0 );
+ PRMSG(1, "TLIAccept() failed to open a new endpoint\n");
t_free((char *)call,T_CALL);
*status = TRANS_ACCEPT_MISC_ERROR;
return NULL;
@@ -908,9 +867,7 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
if( TRANS(TLITLIBindLocal)(newciptr->fd,TLItrans2devtab[i].family,"") < 0 )
{
- PRMSG(1,
- "TLIAccept: TRANS(TLITLIBindLocal)() failed: %d\n",
- errno, 0,0 );
+ PRMSG(1,"TLIAccept: TRANS(TLITLIBindLocal)() failed: %d\n",errno);
t_free((char *)call,T_CALL);
t_close(newciptr->fd);
xfree(newciptr);
@@ -923,19 +880,19 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
{
extern char *t_errlist[];
extern int t_errno;
- PRMSG(1, "TLIAccept() t_accept() failed\n", 0,0,0 );
- PRMSG(1, "TLIAccept: %s\n", t_errlist[t_errno], 0,0 );
+ PRMSG(1, "TLIAccept() t_accept() failed\n");
+ PRMSG(1, "TLIAccept: %s\n", t_errlist[t_errno]);
if( t_errno == TLOOK )
{
int evtype = t_look(ciptr->fd);
- PRMSG(1, "TLIAccept() t_look() returned %d\n", evtype,0,0 );
+ PRMSG(1, "TLIAccept() t_look() returned %d\n", evtype);
switch( evtype )
{
case T_DISCONNECT:
if( t_rcvdis(ciptr->fd, NULL) < 0 )
{
- PRMSG(1, "TLIAccept() t_rcvdis() failed\n", 0,0,0 );
- PRMSG(1, "TLIAccept: %s\n", t_errlist[t_errno], 0,0 );
+ PRMSG(1, "TLIAccept() t_rcvdis() failed\n");
+ PRMSG(1, "TLIAccept: %s\n", t_errlist[t_errno]);
}
break;
default:
@@ -953,9 +910,7 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
if( TRANS(TLIGetAddr)(newciptr) < 0 )
{
- PRMSG(1,
- "TLIAccept: TRANS(TLIGetPeerAddr)() failed: %d\n",
- errno, 0,0 );
+ PRMSG(1,"TLIAccept: TRANS(TLIGetPeerAddr)() failed: %d\n",errno);
t_close(newciptr->fd);
xfree(newciptr);
*status = TRANS_ACCEPT_MISC_ERROR;
@@ -964,9 +919,7 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
if( TRANS(TLIGetPeerAddr)(newciptr) < 0 )
{
- PRMSG(1,
- "TLIAccept: TRANS(TLIGetPeerAddr)() failed: %d\n",
- errno, 0,0 );
+ PRMSG(1,"TLIAccept: TRANS(TLIGetPeerAddr)() failed: %d\n",errno);
t_close(newciptr->fd);
xfree(newciptr->addr);
xfree(newciptr);
@@ -976,8 +929,7 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
if( ioctl(newciptr->fd, I_POP,"timod") < 0 )
{
- PRMSG(1, "TLIAccept() ioctl(I_POP, \"timod\") failed %d\n",
- errno,0,0 );
+ PRMSG(1, "TLIAccept() ioctl(I_POP, \"timod\") failed %d\n",errno);
t_close(newciptr->fd);
xfree(newciptr->addr);
xfree(newciptr);
@@ -987,8 +939,7 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status)
if( ioctl(newciptr->fd, I_PUSH,"tirdwr") < 0 )
{
- PRMSG(1, "TLIAccept() ioctl(I_PUSH,\"tirdwr\") failed %d\n",
- errno,0,0 );
+ PRMSG(1, "TLIAccept() ioctl(I_PUSH,\"tirdwr\") failed %d\n",errno);
t_close(newciptr->fd);
xfree(newciptr->addr);
xfree(newciptr);
@@ -1016,8 +967,8 @@ TRANS(TLIConnect)(XtransConnInfo ciptr, struct t_call *sndcall )
{
extern char *t_errlist[];
extern int t_errno;
- PRMSG(1, "TLIConnect() t_connect() failed\n", 0,0,0 );
- PRMSG(1, "TLIConnect: %s\n", t_errlist[t_errno], 0,0 );
+ PRMSG(1, "TLIConnect() t_connect() failed\n");
+ PRMSG(1, "TLIConnect: %s\n", t_errlist[t_errno]);
t_free((char *)sndcall,T_CALL);
if (t_errno == TLOOK && t_look(ciptr->fd) == T_DISCONNECT)
{
@@ -1036,31 +987,25 @@ TRANS(TLIConnect)(XtransConnInfo ciptr, struct t_call *sndcall )
if( TRANS(TLIGetAddr)(ciptr) < 0 )
{
- PRMSG(1,
- "TLIConnect: ...TLIGetAddr() failed: %d\n",
- errno, 0,0 );
+ PRMSG(1,"TLIConnect: ...TLIGetAddr() failed: %d\n",errno);
return TRANS_CONNECT_FAILED;
}
if( TRANS(TLIGetPeerAddr)(ciptr) < 0 )
{
- PRMSG(1,
- "TLIConnect: ...TLIGetPeerAddr() failed: %d\n",
- errno, 0,0 );
+ PRMSG(1,"TLIConnect: ...TLIGetPeerAddr() failed: %d\n",errno);
return TRANS_CONNECT_FAILED;
}
if( ioctl(ciptr->fd, I_POP,"timod") < 0 )
{
- PRMSG(1, "TLIConnect() ioctl(I_POP,\"timod\") failed %d\n",
- errno,0,0 );
+ PRMSG(1, "TLIConnect() ioctl(I_POP,\"timod\") failed %d\n",errno);
return TRANS_CONNECT_FAILED;
}
if( ioctl(ciptr->fd, I_PUSH,"tirdwr") < 0 )
{
- PRMSG(1, "TLIConnect() ioctl(I_PUSH,\"tirdwr\") failed %d\n",
- errno,0,0 );
+ PRMSG(1, "TLIConnect() ioctl(I_PUSH,\"tirdwr\") failed %d\n",errno);
return TRANS_CONNECT_FAILED;
}
@@ -1076,7 +1021,7 @@ TRANS(TLIINETConnect)(XtransConnInfo ciptr, char *host, char *port)
struct t_call *sndcall;
long tmpport;
- PRMSG(2, "TLIINETConnect(%s,%s)\n", host, port, 0);
+ PRMSG(2, "TLIINETConnect(%s,%s)\n", host, port);
#ifdef X11_t
/*
@@ -1098,14 +1043,13 @@ TRANS(TLIINETConnect)(XtransConnInfo ciptr, char *host, char *port)
if( (sndcall=(struct t_call *)t_alloc(ciptr->fd,T_CALL,T_ALL)) == NULL )
{
- PRMSG(1, "TLIINETConnect() failed to allocate a t_call\n", 0,0,0 );
+ PRMSG(1, "TLIINETConnect() failed to allocate a t_call\n");
return TRANS_CONNECT_FAILED;
}
if( TRANS(TLIAddrToNetbuf)(ciptr->index, host, port, &(sndcall->addr) ) < 0 )
{
- PRMSG(1, "TLIINETConnect() unable to resolve name:%s.%s\n",
- host, port, 0 );
+ PRMSG(1, "TLIINETConnect() unable to resolve name:%s.%s\n", host, port);
t_free((char *)sndcall,T_CALL);
return TRANS_CONNECT_FAILED;
}
@@ -1122,20 +1066,18 @@ TRANS(TLITLIConnect)(XtransConnInfo ciptr, char *host, char *port)
struct sockaddr_un *sunaddr;
int ret_value;
- PRMSG(2, "TLITLIConnect(%s,%s)\n", host, port, 0);
+ PRMSG(2, "TLITLIConnect(%s,%s)\n", host, port);
if( (sndcall=(struct t_call *)t_alloc(ciptr->fd,T_CALL,T_OPT|T_UDATA)) == NULL )
{
- PRMSG(1, "TLITLIConnect() failed to allocate a t_call\n", 0,0,0 );
+ PRMSG(1, "TLITLIConnect() failed to allocate a t_call\n");
return TRANS_CONNECT_FAILED;
}
if( (sunaddr=(struct sockaddr_un *)
malloc(sizeof(struct sockaddr_un))) == NULL )
{
- PRMSG(1,
- "TLITLIConnect: failed to allocate a sockaddr_un\n",
- 0,0,0 );
+ PRMSG(1,"TLITLIConnect: failed to allocate a sockaddr_un\n");
t_free((char *)sndcall,T_CALL);
return TRANS_CONNECT_FAILED;
}
@@ -1252,7 +1194,7 @@ static int
TRANS(TLIDisconnect)(XtransConnInfo ciptr)
{
- PRMSG(2, "TLIDisconnect(%x->%d)\n", ciptr, ciptr->fd, 0 );
+ PRMSG(2, "TLIDisconnect(%x->%d)\n", ciptr, ciptr->fd);
/*
* Restore the TLI modules so that the connection can be properly shutdown.
@@ -1272,7 +1214,7 @@ static int
TRANS(TLIClose)(XtransConnInfo ciptr)
{
- PRMSG(2, "TLIClose(%x->%d)\n", ciptr, ciptr->fd, 0 );
+ PRMSG(2, "TLIClose(%x->%d)\n", ciptr, ciptr->fd);
t_unbind(ciptr->fd);
@@ -1288,7 +1230,7 @@ TRANS(TLICloseForCloning)(XtransConnInfo ciptr)
* Don't unbind.
*/
- PRMSG(2, "TLICloseForCloning(%x->%d)\n", ciptr, ciptr->fd, 0 );
+ PRMSG(2, "TLICloseForCloning(%x->%d)\n", ciptr, ciptr->fd);
return (t_close(ciptr->fd));
}
diff --git a/Xtransutil.c b/Xtransutil.c
index 0f7c7b2..e690649 100644
--- a/Xtransutil.c
+++ b/Xtransutil.c
@@ -91,7 +91,7 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp)
{
- PRMSG(2,"ConvertAddress(%d,%d,%x)\n",*familyp,*addrlenp,*addrp);
+ PRMSG(2,"ConvertAddress(%d,%d,%p)\n",*familyp,*addrlenp,*addrp);
switch( *familyp )
{
@@ -178,8 +178,7 @@ 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;
}
@@ -430,7 +429,7 @@ TRANS(WSAStartup) (void)
{
static WSADATA wsadata;
- PRMSG (2,"WSAStartup()\n", 0, 0, 0);
+ PRMSG (2,"WSAStartup()\n");
if (!wsadata.wVersion && WSAStartup(MAKEWORD(2,2), &wsadata))
return 1;
@@ -479,7 +478,7 @@ 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);
+ path, errno);
return -1;
}
/* Dir doesn't exist. Try to create it */
@@ -494,13 +493,13 @@ trans_mkdir(char *path, int mode)
if (mode & 01000) {
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);
+ path);
}
}
#endif
@@ -509,7 +508,7 @@ trans_mkdir(char *path, int mode)
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);
+ path, mode);
#ifdef FAIL_HARD
return -1;
#endif
@@ -519,7 +518,7 @@ trans_mkdir(char *path, int mode)
#endif
} else {
PRMSG(1, "mkdir: ERROR: Cannot create %s\n",
- path, 0, 0);
+ path);
return -1;
}
@@ -578,7 +577,7 @@ trans_mkdir(char *path, int mode)
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);
+ path, errno);
return -1;
}
/*
@@ -589,7 +588,7 @@ trans_mkdir(char *path, int 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);
+ path);
return -1;
}
if (updateOwner && fchown(fd, 0, 0) == 0)
@@ -605,13 +604,13 @@ trans_mkdir(char *path, int mode)
#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);
+ path);
return -1;
}
#endif
#ifndef __APPLE_CC__
PRMSG(1, "mkdir: Owner of %s should be set to root\n",
- path, 0, 0);
+ path);
#endif
}
@@ -619,15 +618,14 @@ trans_mkdir(char *path, int mode)
#ifdef FAIL_HARD
if (status & FAIL_IF_NOMODE) {
PRMSG(1, "mkdir: ERROR: Mode of %s must be set to %04o\n",
- path, mode, 0);
+ path, mode);
return -1;
}
#endif
PRMSG(1, "mkdir: Mode of %s should be set to %04o\n",
- path, mode, 0);
+ 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;
--
1.6.1.2
More information about the xorg
mailing list