Changeset 60:d1fa94aadc08 in roaraudio for libroar
- Timestamp:
- 07/12/08 12:19:08 (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/socket.c
r2 r60 65 65 int fh; 66 66 struct sockaddr_in socket_addr; 67 struct sockaddr_un socket_addr_un; 67 68 struct hostent * he; 68 69 //unsigned int host_div = 0; … … 82 83 type == ROAR_SOCKET_TYPE_UNIX ? "UNIX" : "INET", host, port); 83 84 84 memset(&socket_addr, 0, sizeof(socket_addr)); 85 memset(&he, 0, sizeof(he)); 85 memset(&socket_addr , 0, sizeof(socket_addr)); 86 memset(&socket_addr_un, 0, sizeof(socket_addr_un)); 87 memset(&he, 0, sizeof(he)); // FIXME: we have a valid pointer in here???? 86 88 87 89 … … 109 111 // hey! we have a socket... 110 112 } else { 113 socket_addr_un.sun_family = AF_UNIX; 114 strncpy(socket_addr_un.sun_path, host, sizeof(socket_addr_un.sun_path) - 1); 115 111 116 fh = roar_socket_new_unix(); 112 close(fh); 113 return -1; 117 118 if ( mode_func(fh, (struct sockaddr *)&socket_addr_un, sizeof(struct sockaddr_un)) == -1 ) { 119 ROAR_DBG("roar_socket_open(*): Can not connect/bind: %s", strerror(errno)); 120 close(fh); 121 return -1; 122 } 114 123 } 115 124
Note: See TracChangeset
for help on using the changeset viewer.