On Thu, Dec 31, 2009 at 02:25:00PM +0000, Mike Belopuhov wrote: > On Thu, Dec 31, 2009 at 14:27 +0100, Pedro Martelletto wrote: > > On Wed, Dec 30, 2009 at 07:27:42PM +0000, konrad merz wrote: > > > Index: usr.sbin/icbd/cmd.c > > > =================================================================== > > > RCS file: /cvs/src/usr.sbin/icbd/cmd.c,v > > > retrieving revision 1.19 > > > diff -u -p -r1.19 cmd.c > > > --- usr.sbin/icbd/cmd.c 23 Jun 2009 13:39:33 -0000 1.19 > > > +++ usr.sbin/icbd/cmd.c 30 Dec 2009 19:06:18 -0000 > > > @@ -227,9 +227,15 @@ icb_cmd_topic(struct icb_cmdarg *ca) > > > char buf[ICB_MAXGRPLEN + ICB_MAXTOPICLEN + 25]; > > > struct icb_group *ig = ca->sess->group; > > > > > > - if (strlen(ca->arg) == 0) { > > > - (void)snprintf(buf, sizeof buf, "Topic for %s is \"%s\"", > > > - ig->name, ig->topic); > > > + if (ca->arg == NULL) { > > > + if (strlen(ig->topic) > 0) > > > + (void)snprintf(buf, sizeof buf, > > > + "Topic for %s is \"%s\"", > > > + ig->name, ig->topic); > > > + else > > > + (void)snprintf(buf, sizeof buf, "No topic set for %s", > > > + ig->name); > > > + > > > icb_status(ca->sess, STATUS_TOPIC, buf); > > > return; > > > } > > > Index: usr.sbin/icbd/dns.c > > > =================================================================== > > > RCS file: /cvs/src/usr.sbin/icbd/dns.c,v > > > retrieving revision 1.1 > > > diff -u -p -r1.1 dns.c > > > --- usr.sbin/icbd/dns.c 23 Jun 2009 13:39:33 -0000 1.1 > > > +++ usr.sbin/icbd/dns.c 30 Dec 2009 19:06:18 -0000 > > > @@ -114,7 +114,7 @@ dns_dispatch(int fd, short event, void * > > > > > > if (read(fd, &ss, ss_len) != ss_len) { > > > syslog(LOG_ERR, "dns read: %m"); > > > - return; > > > + exit(1); > > > } > > > > > > if ((gerr = getnameinfo(sa, sa->sa_len, > > > > diff looks correct. ok by me. > > > > this diff is not correct. you don't want to exit dns resolver > if read returns less then expected. you want to exit if it returns > -1.
no. you have to fail if it returns less. cu -- paranoic mickey (my employers have changed but, the name has remained)