Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Paul Warren
iftop
Commits
fbef5fdb
Commit
fbef5fdb
authored
Nov 06, 2003
by
chris
Browse files
""
parent
027a0242
Changes
3
Hide whitespace changes
Inline
Side-by-side
Makefile.am
View file @
fbef5fdb
...
...
@@ -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
...
...
configure.in
View file @
fbef5fdb
...
...
@@ -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])
...
...
resolver.c
View file @
fbef5fdb
...
...
@@ -320,7 +320,7 @@ char *do_resolve(struct in_addr *addr) {
workerinfo
=
xmalloc
(
sizeof
*
workerinfo
);
pthread_setspecific
(
worker_key
,
workerinfo
);
workerinfo
->
fd
=
p
[
0
];
switch
(
workerinfo
->
child
=
fork
())
{
case
0
:
close
(
p
[
0
]);
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment