Use socklen_t instead of int32_t where appropriate to pacify new GCC4

warnings.

Submitted by:	kan
MFC after:	1 week
This commit is contained in:
Maksim Yevmenkin 2006-09-21 02:32:28 +00:00
parent f340c84ebe
commit 831a4264af
5 changed files with 12 additions and 7 deletions

View File

@ -119,7 +119,8 @@ client_connect(bthid_server_p srv, int32_t fd)
{
bthid_session_p s;
hid_device_p d;
int32_t error, len;
int32_t error;
socklen_t len;
assert(srv != NULL);
assert(fd >= 0);

View File

@ -223,7 +223,8 @@ server_accept(bthid_server_p srv, int32_t fd)
bthid_session_p s;
hid_device_p d;
struct sockaddr_l2cap l2addr;
int32_t len, new_fd;
int32_t new_fd;
socklen_t len;
len = sizeof(l2addr);
if ((new_fd = accept(fd, (struct sockaddr *) &l2addr, &len)) < 0) {

View File

@ -65,7 +65,8 @@ static void usage
int
main(int argc, char *argv[])
{
int n, detach, sock, size;
int n, detach, sock;
socklen_t size;
struct sigaction sa;
struct sockaddr_hci addr;
struct ng_btsocket_hci_raw_filter filter;

View File

@ -301,8 +301,8 @@ main(int argc, char *argv[])
}
for (done = 0; !done; ) {
int len = sizeof(sock_addr);
int s1 = accept(s, (struct sockaddr *) &sock_addr, &len);
socklen_t len = sizeof(sock_addr);
int s1 = accept(s, (struct sockaddr *) &sock_addr, &len);
if (s1 < 0) {
syslog(LOG_ERR, "Could not accept connection " \

View File

@ -66,7 +66,8 @@ server_init(server_p srv, char const *control)
{
struct sockaddr_un un;
struct sockaddr_l2cap l2;
int32_t unsock, l2sock, size;
int32_t unsock, l2sock;
socklen_t size;
uint16_t imtu;
assert(srv != NULL);
@ -289,8 +290,9 @@ static void
server_accept_client(server_p srv, int32_t fd)
{
uint8_t *rsp = NULL;
int32_t cfd, size, priv;
int32_t cfd, priv;
uint16_t omtu;
socklen_t size;
do {
cfd = accept(fd, NULL, NULL);