""
This commit is contained in:
@@ -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 \
|
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 \
|
screenfilter.h serv_hash.h sll.h sorted_list.h tcp.h \
|
||||||
threadprof.h token.h ui.h dlcommon.h stringmap.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
|
man_MANS = iftop.8
|
||||||
|
|
||||||
|
|||||||
@@ -37,9 +37,9 @@ AC_ARG_WITH(resolver,
|
|||||||
[ --with-resolver=TYPE Technique iftop should use for name resolution. Valid
|
[ --with-resolver=TYPE Technique iftop should use for name resolution. Valid
|
||||||
options are netdb, netdb_1thread (for systems without
|
options are netdb, netdb_1thread (for systems without
|
||||||
working gethostbyaddr_r), ares for the MIT ARES
|
working gethostbyaddr_r), ares for the MIT ARES
|
||||||
asynchronous resolver library, forking for the REALLY SUCKY
|
asynchronous resolver library, forking for the REALLY
|
||||||
forking resolver, or none if you don't need any name
|
SUCKY forking resolver, or none if you don't need any
|
||||||
resolution.
|
name resolution.
|
||||||
[default=netdb]],
|
[default=netdb]],
|
||||||
[resolver=$withval],
|
[resolver=$withval],
|
||||||
[resolver=netdb])
|
[resolver=netdb])
|
||||||
|
|||||||
@@ -332,6 +332,7 @@ char *do_resolve(struct in_addr *addr) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
default:
|
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]);
|
close(p[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -340,11 +341,13 @@ char *do_resolve(struct in_addr *addr) {
|
|||||||
if (write(workerinfo->fd, addr, sizeof *addr) != sizeof *addr
|
if (write(workerinfo->fd, addr, sizeof *addr) != sizeof *addr
|
||||||
|| read(workerinfo->fd, name, NAMESIZE) != NAMESIZE) {
|
|| read(workerinfo->fd, name, NAMESIZE) != NAMESIZE) {
|
||||||
/* Something went wrong. Just kill the child and get on with it. */
|
/* 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);
|
kill(workerinfo->child, SIGKILL);
|
||||||
wait();
|
wait();
|
||||||
close(workerinfo->fd);
|
close(workerinfo->fd);
|
||||||
xfree(workerinfo);
|
xfree(workerinfo);
|
||||||
pthread_setspecific(worker_key, NULL);
|
pthread_setspecific(worker_key, NULL);
|
||||||
|
*name = 0;
|
||||||
}
|
}
|
||||||
if (!*name)
|
if (!*name)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user