aboutsummaryrefslogtreecommitdiff
path: root/X11/xtrans/Xtranslcl.c
diff options
context:
space:
mode:
Diffstat (limited to 'X11/xtrans/Xtranslcl.c')
-rw-r--r--X11/xtrans/Xtranslcl.c369
1 files changed, 181 insertions, 188 deletions
diff --git a/X11/xtrans/Xtranslcl.c b/X11/xtrans/Xtranslcl.c
index b95a3411b..8466ddc4c 100644
--- a/X11/xtrans/Xtranslcl.c
+++ b/X11/xtrans/Xtranslcl.c
@@ -123,7 +123,7 @@ static int TRANS(LocalClose)(XtransConnInfo ciptr);
/* Type Not Supported */
static int
-TRANS(OpenFail)(XtransConnInfo ciptr, char *port)
+TRANS(OpenFail)(XtransConnInfo ciptr _X_UNUSED, char *port _X_UNUSED)
{
return -1;
@@ -132,7 +132,7 @@ TRANS(OpenFail)(XtransConnInfo ciptr, char *port)
#ifdef TRANS_REOPEN
static int
-TRANS(ReopenFail)(XtransConnInfo ciptr, int fd, char *port)
+TRANS(ReopenFail)(XtransConnInfo ciptr _X_UNUSED, int fd _X_UNUSED, char *port _X_UNUSED)
{
return 0;
@@ -154,14 +154,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");
xfree((char *) sunaddr);
return 0;
}
@@ -177,9 +177,8 @@ 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 +188,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");
xfree((char *) p_sunaddr);
return 0;
}
@@ -222,7 +221,7 @@ extern char *ptsname(
int
);
-static void _dummy(int sig)
+static void _dummy(int sig _X_UNUSED)
{
}
@@ -315,20 +314,22 @@ 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 ) {
if( *port == '/' ) { /* A full pathname */
- (void) sprintf(server_path, "%s", port);
- } else {
- (void) sprintf(server_path, "%s%s", PTSNODENAME, port);
- }
+ snprintf(server_path, sizeof(server_path), "%s", port);
+ } else {
+ snprintf(server_path, sizeof(server_path), "%s%s",
+ PTSNODENAME, port);
+ }
} else {
- (void) sprintf(server_path, "%s%d", PTSNODENAME, getpid());
+ snprintf(server_path, sizeof(server_path), "%s%d",
+ PTSNODENAME, getpid());
}
@@ -337,7 +338,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;
}
@@ -347,7 +348,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);
close(server);
return(-1);
}
@@ -358,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;
@@ -391,14 +392,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);
}
@@ -425,8 +426,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;
}
@@ -437,7 +438,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;
}
@@ -462,10 +463,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 ) {
@@ -484,8 +485,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);
}
@@ -496,8 +497,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);
}
@@ -508,7 +509,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);
}
@@ -516,25 +517,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);
}
@@ -547,7 +548,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;
}
@@ -567,17 +568,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;
@@ -585,13 +586,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;
@@ -600,7 +601,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;
}
@@ -613,8 +614,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;
@@ -624,8 +624,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;
@@ -668,10 +667,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 ) {
@@ -685,18 +684,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;
@@ -704,7 +703,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;
}
@@ -715,8 +714,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;
}
@@ -736,54 +734,54 @@ TRANS(NAMEDOpenClient)(XtransConnInfo ciptr, char *port)
static int
TRANS(NAMEDOpenPipe)(const char *server_path)
{
- PRMSG(2,"NAMEDOpenPipe(%s)\n", server_path, 0,0 );
-
int fd, pipefd[2];
struct stat sbuf;
int mode;
+ prmsg(2,"NAMEDOpenPipe(%s)\n", server_path);
+
#ifdef HAS_STICKY_DIR_BIT
mode = 01777;
#else
mode = 0777;
#endif
if (trans_mkdir(X_STREAMS_DIR, mode) == -1) {
- PRMSG (1, "NAMEDOpenPipe: mkdir(%s) failed, errno = %d\n",
- X_STREAMS_DIR, errno, 0);
+ prmsg (1, "NAMEDOpenPipe: 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, "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);
@@ -801,10 +799,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 ) {
@@ -830,7 +828,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;
}
@@ -844,11 +842,10 @@ static int
TRANS(NAMEDResetListener) (XtransConnInfo ciptr)
{
- int status = TRANS_RESET_NOOP;
struct sockaddr_un *sockname=(struct sockaddr_un *) ciptr->addr;
struct stat statb;
- PRMSG(2,"NAMEDResetListener(%p, %d)\n", ciptr, ciptr->fd, 0 );
+ prmsg(2,"NAMEDResetListener(%p, %d)\n", ciptr, ciptr->fd);
if (ciptr->fd != -1) {
/*
@@ -857,7 +854,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)
@@ -875,10 +872,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(%p->%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);
}
@@ -889,9 +886,8 @@ 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;
@@ -901,9 +897,8 @@ 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;
@@ -1015,23 +1010,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;
}
@@ -1051,7 +1046,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;
@@ -1075,7 +1070,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;
}
@@ -1101,12 +1096,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);
@@ -1118,7 +1113,7 @@ 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);
if (fds >= 0)
close(fds);
if (fdr >= 0)
@@ -1127,14 +1122,14 @@ TRANS(SCOOpenServer)(XtransConnInfo ciptr, char *port)
}
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;
@@ -1143,7 +1138,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;
}
@@ -1156,22 +1151,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 (fdr < 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;
@@ -1185,7 +1180,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;
@@ -1202,22 +1197,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;
@@ -1229,9 +1224,8 @@ 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;
@@ -1244,9 +1238,8 @@ 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;
@@ -1276,26 +1269,27 @@ 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 ) {
if( *port == '/' ) { /* A full pathname */
- (void) sprintf(server_path, "%s", port);
- } else {
- (void) sprintf(server_path, "%s%s", PTSNODENAME, port);
- }
+ snprintf(server_path, sizeof(server_path), "%s", port);
+ } else {
+ snprintf(server_path, sizeof(server_path), "%s%s",
+ PTSNODENAME, port);
+ }
} else {
- (void) sprintf(server_path, "%s%ld", PTSNODENAME, (long)getpid());
+ snprintf(server_path, sizeof(server_path), "%s%ld",
+ PTSNODENAME, (long)getpid());
}
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;
}
@@ -1309,33 +1303,34 @@ TRANS(PTSReopenServer)(XtransConnInfo ciptr, int fd, char *port)
#ifdef LOCAL_TRANS_NAMED
static int
-TRANS(NAMEDReopenServer)(XtransConnInfo ciptr, int fd, char *port)
+TRANS(NAMEDReopenServer)(XtransConnInfo ciptr, int fd _X_UNUSED, char *port)
{
#ifdef NAMEDNODENAME
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 ) {
if( *port == '/' ) { /* A full pathname */
- (void) sprintf(server_path, "%s", port);
+ snprintf(server_path, sizeof(server_path),"%s", port);
} else {
- (void) sprintf(server_path, "%s%s", NAMEDNODENAME, port);
+ snprintf(server_path, sizeof(server_path), "%s%s",
+ NAMEDNODENAME, port);
}
} else {
- (void) sprintf(server_path, "%s%ld", NAMEDNODENAME, (long)getpid());
+ snprintf(server_path, sizeof(server_path), "%s%ld",
+ NAMEDNODENAME, (long)getpid());
}
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;
}
@@ -1356,12 +1351,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);
@@ -1372,7 +1367,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;
}
@@ -1393,7 +1388,7 @@ TRANS(SCOReopenServer)(XtransConnInfo ciptr, int fd, char *port)
*/
typedef struct _LOCALtrans2dev {
- char *transname;
+ const char *transname;
#ifdef TRANS_CLIENT
@@ -1654,7 +1649,7 @@ static LOCALtrans2dev LOCALtrans2devtab[] = {
#define NUMTRANSPORTS (sizeof(LOCALtrans2devtab)/sizeof(LOCALtrans2dev))
-static char *XLOCAL=NULL;
+static const char *XLOCAL=NULL;
static char *workingXLOCAL=NULL;
static char *freeXLOCAL=NULL;
@@ -1669,10 +1664,10 @@ static char *freeXLOCAL=NULL;
#endif
static void
-TRANS(LocalInitTransports)(char *protocol)
+TRANS(LocalInitTransports)(const char *protocol)
{
- PRMSG(3,"LocalInitTransports(%s)\n", protocol, 0,0 );
+ prmsg(3,"LocalInitTransports(%s)\n", protocol);
if( strcmp(protocol,"local") && strcmp(protocol,"LOCAL") )
{
@@ -1694,7 +1689,7 @@ static void
TRANS(LocalEndTransports)(void)
{
- PRMSG(3,"LocalEndTransports()\n", 0,0,0 );
+ prmsg(3,"LocalEndTransports()\n");
xfree(freeXLOCAL);
}
@@ -1709,7 +1704,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)
{
@@ -1789,7 +1784,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.
@@ -1801,9 +1796,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;
}
@@ -1822,8 +1817,8 @@ 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 );
+ prmsg(1,"LocalOpenClient: calloc(1,%lu) failed\n",
+ sizeof(struct _XtransConnInfo));
return NULL;
}
@@ -1845,14 +1840,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;
@@ -1878,13 +1872,13 @@ TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port)
#ifdef TRANS_SERVER
static XtransConnInfo
-TRANS(LocalOpenServer)(int type, char *protocol, char *host, char *port)
+TRANS(LocalOpenServer)(int type, char *protocol, char *host _X_UNUSED, 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)
/*
@@ -1897,8 +1891,8 @@ 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 );
+ prmsg(1,"LocalOpenServer: calloc(1,%lu) failed\n",
+ sizeof(struct _XtransConnInfo));
return NULL;
}
@@ -1910,9 +1904,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);
@@ -1921,8 +1914,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];
@@ -1948,12 +1941,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)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL )
{
- PRMSG(1,"LocalReopenServer: calloc(1,%d) failed\n",
- sizeof(struct _XtransConnInfo),0,0 );
+ prmsg(1,"LocalReopenServer: calloc(1,%lu) failed\n",
+ sizeof(struct _XtransConnInfo));
return NULL;
}
@@ -1968,8 +1961,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 ) {
@@ -1994,11 +1987,11 @@ TRANS(LocalReopenServer)(int type, int index, int fd, char *port)
#ifdef TRANS_CLIENT
static XtransConnInfo
-TRANS(LocalOpenCOTSClient)(Xtransport *thistrans, char *protocol,
+TRANS(LocalOpenCOTSClient)(Xtransport *thistrans _X_UNUSED, 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);
}
@@ -2017,7 +2010,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");
@@ -2039,7 +2032,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;
}
@@ -2053,11 +2046,11 @@ TRANS(LocalOpenCOTSServer)(Xtransport *thistrans, char *protocol,
#ifdef TRANS_CLIENT
static XtransConnInfo
-TRANS(LocalOpenCLTSClient)(Xtransport *thistrans, char *protocol,
+TRANS(LocalOpenCLTSClient)(Xtransport *thistrans _X_UNUSED, 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);
}
@@ -2068,11 +2061,11 @@ TRANS(LocalOpenCLTSClient)(Xtransport *thistrans, char *protocol,
#ifdef TRANS_SERVER
static XtransConnInfo
-TRANS(LocalOpenCLTSServer)(Xtransport *thistrans, char *protocol,
+TRANS(LocalOpenCLTSServer)(Xtransport *thistrans _X_UNUSED, 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);
}
@@ -2088,7 +2081,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++)
{
@@ -2112,7 +2105,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++)
{
@@ -2138,7 +2131,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;
}
@@ -2147,10 +2140,10 @@ TRANS(LocalSetOption)(XtransConnInfo ciptr, int option, int arg)
#ifdef TRANS_SERVER
static int
-TRANS(LocalCreateListener)(XtransConnInfo ciptr, char *port, unsigned int flags)
+TRANS(LocalCreateListener)(XtransConnInfo ciptr, char *port, unsigned int flags _X_UNUSED)
{
- PRMSG(2,"LocalCreateListener(%x->%d,%s)\n",ciptr,ciptr->fd,port);
+ prmsg(2,"LocalCreateListener(%p->%d,%s)\n",ciptr,ciptr->fd,port);
return 0;
}
@@ -2161,7 +2154,7 @@ TRANS(LocalResetListener)(XtransConnInfo ciptr)
{
LOCALtrans2dev *transptr;
- PRMSG(2,"LocalResetListener(%x)\n",ciptr,0,0);
+ prmsg(2,"LocalResetListener(%p)\n",ciptr);
transptr=(LOCALtrans2dev *)ciptr->priv;
if (transptr->devreset != NULL) {
@@ -2178,14 +2171,14 @@ TRANS(LocalAccept)(XtransConnInfo ciptr, int *status)
XtransConnInfo newciptr;
LOCALtrans2dev *transptr;
- PRMSG(2,"LocalAccept(%x->%d)\n", ciptr, ciptr->fd,0);
+ prmsg(2,"LocalAccept(%p->%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 );
+ prmsg(1,"LocalAccept: calloc(1,%lu) failed\n",
+ sizeof(struct _XtransConnInfo));
*status = TRANS_ACCEPT_BAD_MALLOC;
return NULL;
}
@@ -2212,10 +2205,10 @@ TRANS(LocalAccept)(XtransConnInfo ciptr, int *status)
#ifdef TRANS_CLIENT
static int
-TRANS(LocalConnect)(XtransConnInfo ciptr, char *host, char *port)
+TRANS(LocalConnect)(XtransConnInfo ciptr, char *host _X_UNUSED, char *port)
{
- PRMSG(2,"LocalConnect(%x->%d,%s)\n", ciptr, ciptr->fd, port);
+ prmsg(2,"LocalConnect(%p->%d,%s)\n", ciptr, ciptr->fd, port);
return 0;
}
@@ -2227,7 +2220,7 @@ static int
TRANS(LocalBytesReadable)(XtransConnInfo ciptr, BytesReadable_t *pend )
{
- PRMSG(2,"LocalBytesReadable(%x->%d,%x)\n", ciptr, ciptr->fd, pend);
+ prmsg(2,"LocalBytesReadable(%p->%d,%p)\n", ciptr, ciptr->fd, pend);
#if defined(SCO325)
return ioctl(ciptr->fd, I_NREAD, (char *)pend);
@@ -2240,7 +2233,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,%p,%d)\n", ciptr->fd, buf, size );
return read(ciptr->fd,buf,size);
}
@@ -2249,7 +2242,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,%p,%d)\n", ciptr->fd, buf, size );
return write(ciptr->fd,buf,size);
}
@@ -2258,7 +2251,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,%p,%d)\n", ciptr->fd, buf, size );
return READV(ciptr,buf,size);
}
@@ -2267,7 +2260,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,%p,%d)\n", ciptr->fd, buf, size );
return WRITEV(ciptr,buf,size);
}
@@ -2276,7 +2269,7 @@ static int
TRANS(LocalDisconnect)(XtransConnInfo ciptr)
{
- PRMSG(2,"LocalDisconnect(%x->%d)\n", ciptr, ciptr->fd, 0);
+ prmsg(2,"LocalDisconnect(%p->%d)\n", ciptr, ciptr->fd);
return 0;
}
@@ -2288,7 +2281,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(%p->%d)\n", ciptr, ciptr->fd );
ret=close(ciptr->fd);
@@ -2310,7 +2303,7 @@ TRANS(LocalCloseForCloning)(XtransConnInfo ciptr)
{
int ret;
- PRMSG(2,"LocalCloseForCloning(%x->%d)\n", ciptr, ciptr->fd ,0);
+ prmsg(2,"LocalCloseForCloning(%p->%d)\n", ciptr, ciptr->fd );
/* Don't unlink path */
@@ -2331,7 +2324,7 @@ TRANS(LocalCloseForCloning)(XtransConnInfo ciptr)
*/
#ifdef TRANS_SERVER
-static char * local_aliases[] = {
+static const char * local_aliases[] = {
# ifdef LOCAL_TRANS_PTS
"pts",
# endif