This commit is contained in:
chris
2003-11-06 21:43:31 +00:00
parent 027a02428b
commit fbef5fdbc0
3 changed files with 8 additions and 5 deletions

View File

@@ -22,7 +22,7 @@ noinst_HEADERS = addr_hash.h ether.h ethertype.h extract.h hash.h iftop.h \
integers.h ip.h llc.h ns_hash.h options.h resolver.h \
screenfilter.h serv_hash.h sll.h sorted_list.h tcp.h \
threadprof.h token.h ui.h dlcommon.h stringmap.h \
vector.h cfgfile.h
vector.h cfgfile.h util.h
man_MANS = iftop.8

View File

@@ -37,9 +37,9 @@ AC_ARG_WITH(resolver,
[ --with-resolver=TYPE Technique iftop should use for name resolution. Valid
options are netdb, netdb_1thread (for systems without
working gethostbyaddr_r), ares for the MIT ARES
asynchronous resolver library, forking for the REALLY SUCKY
forking resolver, or none if you don't need any name
resolution.
asynchronous resolver library, forking for the REALLY
SUCKY forking resolver, or none if you don't need any
name resolution.
[default=netdb]],
[resolver=$withval],
[resolver=netdb])

View File

@@ -332,6 +332,7 @@ char *do_resolve(struct in_addr *addr) {
return NULL;
default:
fprintf(stderr, "New child is %d, we have fd %d, he has fd %d\n", workerinfo->child, p[0], p[1]);
close(p[1]);
}
}
@@ -340,11 +341,13 @@ char *do_resolve(struct in_addr *addr) {
if (write(workerinfo->fd, addr, sizeof *addr) != sizeof *addr
|| read(workerinfo->fd, name, NAMESIZE) != NAMESIZE) {
/* Something went wrong. Just kill the child and get on with it. */
fprintf(stderr, "Protocol error (%s) talking to child %d\n", strerror(errno), workerinfo->child);
kill(workerinfo->child, SIGKILL);
wait();
close(workerinfo->fd);
xfree(workerinfo);
pthread_setspecific(worker_key, NULL);
*name = 0;
}
if (!*name)
return NULL;