~ubuntu-branches/ubuntu/maverick/xdm/maverick

« back to all changes in this revision

Viewing changes to socket.c

  • Committer: Bazaar Package Importer
  • Author(s): David Nusinow
  • Date: 2006-06-30 00:42:11 UTC
  • mto: (7.1.1 gutsy)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20060630004211-puz2hz052bab3kq9
Tags: upstream-1.0.5
ImportĀ upstreamĀ versionĀ 1.0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $XdotOrg: xc/programs/xdm/socket.c,v 1.3 2004/07/06 00:44:39 anholt Exp $ */
 
1
/* $XdotOrg: app/xdm/socket.c,v 1.6 2006/03/11 04:07:00 alanc Exp $ */
2
2
/* $Xorg: socket.c,v 1.4 2001/02/09 02:05:40 xorgcvs Exp $ */
3
3
/*
4
4
 
247
247
CreateSocklistEntry(ARRAY8Ptr addr)
248
248
{
249
249
    struct socklist *s = malloc (sizeof(struct socklist));
250
 
    if (s == NULL) 
 
250
    if (s == NULL) {
251
251
        LogOutOfMem("CreateSocklistEntry");
 
252
        return NULL;
 
253
    }
252
254
 
253
255
    bzero(s, sizeof(struct socklist));
254
256
 
256
258
    {
257
259
        struct sockaddr_in *sin;
258
260
        sin = malloc (sizeof(struct sockaddr_in));
259
 
        if (sin == NULL) 
 
261
        if (sin == NULL) {
260
262
            LogOutOfMem("CreateSocklistEntry");
 
263
            free(s);
 
264
            return NULL;
 
265
        }
261
266
        s->addr = (struct sockaddr *) sin;
262
267
 
263
268
        bzero (sin, sizeof (struct sockaddr_in));
275
280
    {
276
281
        struct sockaddr_in6 *sin6;
277
282
        sin6 = malloc (sizeof(struct sockaddr_in6));
278
 
        if (sin6 == NULL) 
 
283
        if (sin6 == NULL) {
279
284
            LogOutOfMem("CreateSocklistEntry");
 
285
            free(s);        
 
286
            return NULL;
 
287
        }
280
288
        s->addr = (struct sockaddr *) sin6;
281
289
 
282
290
        bzero (sin6, sizeof (struct sockaddr_in6));
453
461
        return;
454
462
 
455
463
    ChangeMcastMembership(s, g, JOIN_MCAST_GROUP);
 
464
    g->ref = 1;
 
465
    g->next = s->mcastgroups;
 
466
    s->mcastgroups = g;
456
467
}
457
468
 
458
469
/* Open or close listening sockets to match the current settings read in