Changeset 165
- Timestamp:
- 08/03/04 17:15:01 (9 years ago)
- Location:
- trunk/wifidog/src
- Files:
-
- 2 modified
-
wdctl.c (modified) (1 diff)
-
wdctl_thread.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog/src/wdctl.c
r161 r165 153 153 sa_un.sun_family = AF_UNIX; 154 154 strcpy(sa_un.sun_path, sock_name); 155 /* XXX Again, the + 2 is magical on OS X.... */ 155 156 156 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))) { 158 158 fprintf(stderr, "wdctl: Error: %s\n", strerror(errno)); 159 159 exit(1); -
trunk/wifidog/src/wdctl_thread.c
r161 r165 98 98 debug(LOG_DEBUG, "Binding socket (%s) (%d)", sa_un.sun_path, 99 99 strlen(sock_name)); 100 100 101 /* 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))) { 103 104 debug(LOG_ERR, "Could not bind control socket: %s", 104 105 strerror(errno));
