Use the new style struct sockaddr instead of osockaddr in system calls
so that talkd works without COMPAT_43. Obtained from: NetBSD (christos), Rumi Szabolcs
This commit is contained in:
parent
c32cccd0bb
commit
99d21d504c
@ -86,6 +86,7 @@ main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
register CTL_MSG *mp = &request;
|
register CTL_MSG *mp = &request;
|
||||||
int cc;
|
int cc;
|
||||||
|
struct sockaddr ctl_addr;
|
||||||
|
|
||||||
#ifdef NOTDEF
|
#ifdef NOTDEF
|
||||||
/*
|
/*
|
||||||
@ -116,12 +117,13 @@ main(int argc, char *argv[])
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
lastmsgtime = time(0);
|
lastmsgtime = time(0);
|
||||||
|
(void)memcpy(&ctl_addr, &mp->ctl_addr, sizeof(ctl_addr));
|
||||||
|
ctl_addr.sa_family = ntohs(mp->ctl_addr.sa_family);
|
||||||
|
ctl_addr.sa_len = sizeof(ctl_addr);
|
||||||
process_request(mp, &response);
|
process_request(mp, &response);
|
||||||
/* can block here, is this what I want? */
|
/* can block here, is this what I want? */
|
||||||
mp->ctl_addr.sa_family = htons(mp->ctl_addr.sa_family);
|
cc = sendto(sockt, (char *)&response, sizeof (response), 0,
|
||||||
cc = sendto(sockt, (char *)&response,
|
&ctl_addr, sizeof (ctl_addr));
|
||||||
sizeof (response), 0, (struct sockaddr *)&mp->ctl_addr,
|
|
||||||
sizeof (mp->ctl_addr));
|
|
||||||
if (cc != sizeof (response))
|
if (cc != sizeof (response))
|
||||||
syslog(LOG_WARNING, "sendto: %m");
|
syslog(LOG_WARNING, "sendto: %m");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user