diff options
author | Mikhail Gusarov <dottedmag@dottedmag.net> | 2010-05-06 01:44:06 +0700 |
---|---|---|
committer | Mikhail Gusarov <dottedmag@dottedmag.net> | 2010-05-13 00:22:37 +0700 |
commit | 3f3ff971ecff9936cebafc813af9193b97bba89c (patch) | |
tree | fdbbad794a42488b7ffe41eed7aba4e498335f55 /os/connection.c | |
parent | 96c7ab27c383ec767f62a7a11e5fd76f86363fbc (diff) |
Replace X-allocation functions with their C89 counterparts
The only remaining X-functions used in server are XNF*, the rest is converted to
plain alloc/calloc/realloc/free/strdup.
X* functions are still exported from server and x* macros are still defined in
header file, so both ABI and API are not affected by this change.
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'os/connection.c')
-rw-r--r-- | os/connection.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/os/connection.c b/os/connection.c index 61ba72a80..bbcfa51f6 100644 --- a/os/connection.c +++ b/os/connection.c @@ -226,7 +226,7 @@ void SetConnectionTranslation(int conn, int client) } node = &((*node)->next); } - *node = xalloc(sizeof(struct _ct_node)); + *node = malloc(sizeof(struct _ct_node)); (*node)->next = NULL; (*node)->key = conn; (*node)->value = client; @@ -244,7 +244,7 @@ void ClearConnectionTranslation(void) { struct _ct_node *temp = node; node = node->next; - xfree(temp); + free(temp); } } } @@ -397,7 +397,7 @@ CreateWellKnownSockets(void) } else { - ListenTransFds = xalloc (ListenTransCount * sizeof (int)); + ListenTransFds = malloc(ListenTransCount * sizeof (int)); for (i = 0; i < ListenTransCount; i++) { @@ -679,7 +679,7 @@ ClientAuthorized(ClientPtr client, proto_n, auth_proto, auth_id); } - xfree (from); + free(from); } if (auth_id == (XID) ~0L) { @@ -701,7 +701,7 @@ ClientAuthorized(ClientPtr client, AuthAudit(client, TRUE, (struct sockaddr *) from, fromlen, proto_n, auth_proto, auth_id); - xfree (from); + free(from); } } priv->auth_id = auth_id; @@ -737,7 +737,7 @@ AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time) #endif ) return NullClient; - oc = xalloc(sizeof(OsCommRec)); + oc = malloc(sizeof(OsCommRec)); if (!oc) return NullClient; oc->trans_conn = trans_conn; @@ -748,7 +748,7 @@ AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time) oc->conn_time = conn_time; if (!(client = NextAvailableClient((pointer)oc))) { - xfree (oc); + free(oc); return NullClient; } #if !defined(WIN32) @@ -1040,7 +1040,7 @@ CloseDownConnection(ClientPtr client) #endif CloseDownFileDescriptor(oc); FreeOsBuffers(oc); - xfree(client->osPrivate); + free(client->osPrivate); client->osPrivate = (pointer)NULL; if (auditTrailLevel > 1) AuditF("client %d disconnected\n", client->index); @@ -1276,8 +1276,8 @@ void ListenOnOpenFD(int fd, int noxauth) { ciptr->flags = ciptr->flags | TRANS_NOXAUTH; /* Allocate space to store it */ - ListenTransFds = (int *) xrealloc(ListenTransFds, (ListenTransCount + 1) * sizeof (int)); - ListenTransConns = (XtransConnInfo *) xrealloc(ListenTransConns, (ListenTransCount + 1) * sizeof (XtransConnInfo)); + ListenTransFds = (int *) realloc(ListenTransFds, (ListenTransCount + 1) * sizeof (int)); + ListenTransConns = (XtransConnInfo *) realloc(ListenTransConns, (ListenTransCount + 1) * sizeof (XtransConnInfo)); /* Store it */ ListenTransConns[ListenTransCount] = ciptr; |