mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-23 23:30:02 +00:00
os: xtrans: drop status pointer from *Accept() functions
Nobody's ever looking at this value, so no need to keep it. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt
parent
c9d9da7cf0
commit
7389686d6d
@@ -663,13 +663,13 @@ int _XSERVTransResetListener (XtransConnInfo ciptr)
|
||||
return TRANS_RESET_NOOP;
|
||||
}
|
||||
|
||||
XtransConnInfo _XSERVTransAccept (XtransConnInfo ciptr, int *status)
|
||||
XtransConnInfo _XSERVTransAccept (XtransConnInfo ciptr)
|
||||
{
|
||||
XtransConnInfo newciptr;
|
||||
|
||||
prmsg (2,"Accept(%d)\n", ciptr->fd);
|
||||
|
||||
newciptr = ciptr->transptr->Accept (ciptr, status);
|
||||
newciptr = ciptr->transptr->Accept(ciptr);
|
||||
|
||||
if (newciptr)
|
||||
newciptr->transptr = ciptr->transptr;
|
||||
|
||||
14
os/Xtrans.h
14
os/Xtrans.h
@@ -122,15 +122,6 @@ typedef struct _XtransConnInfo *XtransConnInfo;
|
||||
#define TRANS_ADDR_IN_USE -2
|
||||
|
||||
|
||||
/*
|
||||
* Return values of Accept (0 is success)
|
||||
*/
|
||||
|
||||
#define TRANS_ACCEPT_BAD_MALLOC -1
|
||||
#define TRANS_ACCEPT_FAILED -2
|
||||
#define TRANS_ACCEPT_MISC_ERROR -3
|
||||
|
||||
|
||||
/*
|
||||
* ResetListener return values
|
||||
*/
|
||||
@@ -192,10 +183,7 @@ int _XSERVTransResetListener (
|
||||
XtransConnInfo /* ciptr */
|
||||
);
|
||||
|
||||
XtransConnInfo _XSERVTransAccept (
|
||||
XtransConnInfo, /* ciptr */
|
||||
int * /* status */
|
||||
);
|
||||
XtransConnInfo _XSERVTransAccept (XtransConnInfo ciptr);
|
||||
|
||||
int _XSERVTransRead (
|
||||
XtransConnInfo, /* ciptr */
|
||||
|
||||
@@ -165,10 +165,7 @@ typedef struct _Xtransport {
|
||||
XtransConnInfo /* connection */
|
||||
);
|
||||
|
||||
XtransConnInfo (*Accept)(
|
||||
XtransConnInfo, /* connection */
|
||||
int * /* status */
|
||||
);
|
||||
XtransConnInfo (*Accept)(XtransConnInfo ciptr);
|
||||
|
||||
int (*Read)(
|
||||
XtransConnInfo, /* connection */
|
||||
|
||||
@@ -1021,7 +1021,7 @@ static int _XSERVTransSocketUNIXResetListener (XtransConnInfo ciptr)
|
||||
#ifdef TCPCONN
|
||||
|
||||
static XtransConnInfo _XSERVTransSocketINETAccept (
|
||||
XtransConnInfo ciptr, int *status)
|
||||
XtransConnInfo ciptr)
|
||||
{
|
||||
XtransConnInfo newciptr;
|
||||
struct sockaddr_in sockname;
|
||||
@@ -1032,7 +1032,6 @@ static XtransConnInfo _XSERVTransSocketINETAccept (
|
||||
if ((newciptr = calloc (1, sizeof(struct _XtransConnInfo))) == NULL)
|
||||
{
|
||||
prmsg (1, "SocketINETAccept: malloc failed\n");
|
||||
*status = TRANS_ACCEPT_BAD_MALLOC;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1044,7 +1043,6 @@ static XtransConnInfo _XSERVTransSocketINETAccept (
|
||||
#endif
|
||||
prmsg (1, "SocketINETAccept: accept() failed\n");
|
||||
free (newciptr);
|
||||
*status = TRANS_ACCEPT_FAILED;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1071,7 +1069,6 @@ static XtransConnInfo _XSERVTransSocketINETAccept (
|
||||
"SocketINETAccept: ...SocketINETGetAddr() failed:\n");
|
||||
ossock_close(newciptr->fd);
|
||||
free (newciptr);
|
||||
*status = TRANS_ACCEPT_MISC_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1082,12 +1079,9 @@ static XtransConnInfo _XSERVTransSocketINETAccept (
|
||||
ossock_close(newciptr->fd);
|
||||
if (newciptr->addr) free (newciptr->addr);
|
||||
free (newciptr);
|
||||
*status = TRANS_ACCEPT_MISC_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
*status = 0;
|
||||
|
||||
return newciptr;
|
||||
}
|
||||
|
||||
@@ -1096,7 +1090,7 @@ static XtransConnInfo _XSERVTransSocketINETAccept (
|
||||
|
||||
#ifdef UNIXCONN
|
||||
static XtransConnInfo _XSERVTransSocketUNIXAccept (
|
||||
XtransConnInfo ciptr, int *status)
|
||||
XtransConnInfo ciptr)
|
||||
{
|
||||
XtransConnInfo newciptr;
|
||||
struct sockaddr_un sockname;
|
||||
@@ -1107,7 +1101,6 @@ static XtransConnInfo _XSERVTransSocketUNIXAccept (
|
||||
if ((newciptr = calloc (1, sizeof(struct _XtransConnInfo))) == NULL)
|
||||
{
|
||||
prmsg (1, "SocketUNIXAccept: malloc() failed\n");
|
||||
*status = TRANS_ACCEPT_BAD_MALLOC;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1116,7 +1109,6 @@ static XtransConnInfo _XSERVTransSocketUNIXAccept (
|
||||
{
|
||||
prmsg (1, "SocketUNIXAccept: accept() failed\n");
|
||||
free (newciptr);
|
||||
*status = TRANS_ACCEPT_FAILED;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1132,7 +1124,6 @@ static XtransConnInfo _XSERVTransSocketUNIXAccept (
|
||||
"SocketUNIXAccept: Can't allocate space for the addr\n");
|
||||
ossock_close(newciptr->fd);
|
||||
free (newciptr);
|
||||
*status = TRANS_ACCEPT_BAD_MALLOC;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1151,7 +1142,6 @@ static XtransConnInfo _XSERVTransSocketUNIXAccept (
|
||||
ossock_close(newciptr->fd);
|
||||
if (newciptr->addr) free (newciptr->addr);
|
||||
free (newciptr);
|
||||
*status = TRANS_ACCEPT_BAD_MALLOC;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1160,8 +1150,6 @@ static XtransConnInfo _XSERVTransSocketUNIXAccept (
|
||||
|
||||
newciptr->family = AF_UNIX;
|
||||
|
||||
*status = 0;
|
||||
|
||||
return newciptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -621,7 +621,6 @@ EstablishNewConnections(int curconn, int ready, void *data)
|
||||
ClientPtr client;
|
||||
OsCommPtr oc;
|
||||
XtransConnInfo trans_conn, new_trans_conn;
|
||||
int status;
|
||||
|
||||
connect_time = GetTimeInMillis();
|
||||
/* kill off stragglers */
|
||||
@@ -638,7 +637,7 @@ EstablishNewConnections(int curconn, int ready, void *data)
|
||||
if ((trans_conn = lookup_trans_conn(curconn)) == NULL)
|
||||
return;
|
||||
|
||||
if ((new_trans_conn = _XSERVTransAccept(trans_conn, &status)) == NULL)
|
||||
if ((new_trans_conn = _XSERVTransAccept(trans_conn)) == NULL)
|
||||
return;
|
||||
|
||||
newconn = _XSERVTransGetConnectionNumber(new_trans_conn);
|
||||
@@ -1008,7 +1007,6 @@ ListenOnOpenFD(int fd, int noxauth)
|
||||
ListenTransCount++;
|
||||
}
|
||||
|
||||
/* based on _XSERVTransSocketUNIXAccept (XtransConnInfo ciptr, int *status) */
|
||||
Bool
|
||||
AddClientOnOpenFD(int fd)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user