aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/ndb/dnnotify.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2006-02-14 19:43:19 +0000
committerrsc <devnull@localhost>2006-02-14 19:43:19 +0000
commit5c9f76b5e5dc5c0537896b0e487b101dad38a746 (patch)
treedfee973b76db00b0e011610298ca13c5a997e1c9 /src/cmd/ndb/dnnotify.c
parent54357361fbc3032b36688bb4c1d4ced1f14f08f6 (diff)
downloadplan9port-5c9f76b5e5dc5c0537896b0e487b101dad38a746.tar.gz
plan9port-5c9f76b5e5dc5c0537896b0e487b101dad38a746.tar.bz2
plan9port-5c9f76b5e5dc5c0537896b0e487b101dad38a746.zip
remove unused
Diffstat (limited to 'src/cmd/ndb/dnnotify.c')
-rwxr-xr-xsrc/cmd/ndb/dnnotify.c35
1 files changed, 13 insertions, 22 deletions
diff --git a/src/cmd/ndb/dnnotify.c b/src/cmd/ndb/dnnotify.c
index a5d91005..8e4b3075 100755
--- a/src/cmd/ndb/dnnotify.c
+++ b/src/cmd/ndb/dnnotify.c
@@ -46,6 +46,10 @@ syslog(0, logfile, "serial old %lud new %lud", a->soarr->soa->serial, repp->qd->
a->needrefresh = 1;
}
+/*
+ * this isn't going to work as a thread!
+ */
+
static void
ding(void *u, char *msg)
{
@@ -62,10 +66,10 @@ static void
send_notify(char *slave, RR *soa, Request *req)
{
int i, len, n, reqno, status, fd;
- uchar obuf[Maxudp+OUdphdrsize];
- uchar ibuf[Maxudp+OUdphdrsize];
+ uchar obuf[Maxudp+Udphdrsize];
+ uchar ibuf[Maxudp+Udphdrsize];
RR *rp;
- OUdphdr *up = (OUdphdr*)obuf;
+ Udphdr *up = (Udphdr*)obuf;
char *err;
DNSmsg repmsg;
@@ -93,14 +97,14 @@ send_notify(char *slave, RR *soa, Request *req)
/* send 3 times or until we get anything back */
for(i = 0; i < 3; i++){
syslog(0, logfile, "sending %d byte notify to %s/%I.%d about %s", n, slave, up->raddr, nhgets(up->rport), soa->owner->name);
- if(udpwrite(fd, (OUdphdr*)obuf, obuf+OUdphdrsize, n) != n)
+ if(udpwrite(fd, (Udphdr*)obuf, obuf+Udphdrsize, n) != n)
break;
alarm(2*1000);
- len = udpread(fd, (Udphdr*)ibuf, ibuf+OUdphdrsize, Maxudp);
+ len = udpread(fd, (Udphdr*)ibuf, ibuf+Udphdrsize, Maxudp);
alarm(0);
- if(len <= OUdphdrsize)
+ if(len <= Udphdrsize)
continue;
- err = convM2DNS(&ibuf[OUdphdrsize], len, &repmsg);
+ err = convM2DNS(&ibuf[Udphdrsize], len, &repmsg);
if(err != nil)
continue;
if(repmsg.id == reqno && (repmsg.flags & Omask) == Onotify)
@@ -132,24 +136,11 @@ notify_areas(Area *a, Request *req)
* (also reads in new databases)
*/
void
-notifyproc(void)
+notifyproc(void *v)
{
Request req;
- static int already;
-
- if(already)
- return;
-
- switch(rfork(RFPROC|RFNOTEG|RFMEM|RFNOWAIT)){
- case -1:
- return;
- case 0:
- break;
- default:
- return;
- }
- req.isslave = 1; /* son't fork off subprocesses */
+ USED(v);
for(;;){
getactivity(&req);