Changeset 165

Show
Ignore:
Timestamp:
08/03/04 17:15:01 (9 years ago)
Author:
alexcv
Message:

replaced magic constant with correct computed value

Location:
trunk/wifidog/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog/src/wdctl.c

    r161 r165  
    153153        sa_un.sun_family = AF_UNIX; 
    154154        strcpy(sa_un.sun_path, sock_name); 
    155         /* XXX Again, the + 2 is magical on OS X.... */ 
     155 
    156156        if (connect(sock, (struct sockaddr *)&sa_un,  
    157                                 strlen(sa_un.sun_path) + 2)) { 
     157                        strlen(sa_un.sun_path) + sizeof(sa_un.sun_family))) { 
    158158                fprintf(stderr, "wdctl: Error: %s\n", strerror(errno)); 
    159159                exit(1); 
  • trunk/wifidog/src/wdctl_thread.c

    r161 r165  
    9898        debug(LOG_DEBUG, "Binding socket (%s) (%d)", sa_un.sun_path, 
    9999                        strlen(sock_name)); 
     100         
    100101        /* Which to use, AF_UNIX, PF_UNIX, AF_LOCAL, PF_LOCAL? */ 
    101         /* XXX That +2 seems to be needed in OS X. Not sure why. */ 
    102         if (bind(sock, (struct sockaddr *)&sa_un, strlen(sock_name) + 2)) { 
     102        if (bind(sock, (struct sockaddr *)&sa_un, strlen(sock_name)  
     103                                + sizeof(sa_un.sun_family))) { 
    103104                debug(LOG_ERR, "Could not bind control socket: %s", 
    104105                                strerror(errno));