diff options
author | tjr <tjr@FreeBSD.org> | 2003-09-28 09:16:09 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2003-09-28 09:16:09 +0000 |
commit | e6d1ceacacdd5a90a96e676d5d9dce36343419c3 (patch) | |
tree | 2ee231ae925c27cf38b2a25fac1aa5f5ac5b5e56 /libexec | |
parent | 47dfa30bbab1d0a8587610dc2242db6721c09c9d (diff) | |
download | FreeBSD-src-e6d1ceacacdd5a90a96e676d5d9dce36343419c3.zip FreeBSD-src-e6d1ceacacdd5a90a96e676d5d9dce36343419c3.tar.gz |
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
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/talkd/talkd.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libexec/talkd/talkd.c b/libexec/talkd/talkd.c index ae2c6eb..66ae372 100644 --- a/libexec/talkd/talkd.c +++ b/libexec/talkd/talkd.c @@ -86,6 +86,7 @@ main(int argc, char *argv[]) { register CTL_MSG *mp = &request; int cc; + struct sockaddr ctl_addr; #ifdef NOTDEF /* @@ -116,12 +117,13 @@ main(int argc, char *argv[]) continue; } 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); /* 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, (struct sockaddr *)&mp->ctl_addr, - sizeof (mp->ctl_addr)); + cc = sendto(sockt, (char *)&response, sizeof (response), 0, + &ctl_addr, sizeof (ctl_addr)); if (cc != sizeof (response)) syslog(LOG_WARNING, "sendto: %m"); } |