Fixes file descriptor leak in standalone mode.
Prevents simultaneous calls to updatestat() as function is not reentrant. PR: bin/24857 Submitted by: Martin Butkus <mb@bagheera.thgwf.de> MFC after: 1 month
This commit is contained in:
parent
5635f2a580
commit
685233abc5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=81080
@ -115,6 +115,7 @@ stat_init()
|
|||||||
{
|
{
|
||||||
stat_is_init = 1;
|
stat_is_init = 1;
|
||||||
setup();
|
setup();
|
||||||
|
alarm(0);
|
||||||
updatestat();
|
updatestat();
|
||||||
(void) signal(SIGALRM, updatestat);
|
(void) signal(SIGALRM, updatestat);
|
||||||
alarm(1);
|
alarm(1);
|
||||||
@ -203,6 +204,7 @@ updatestat()
|
|||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "about to closedown\n");
|
fprintf(stderr, "about to closedown\n");
|
||||||
#endif
|
#endif
|
||||||
|
kvm_close(kd);
|
||||||
if (from_inetd)
|
if (from_inetd)
|
||||||
exit(0);
|
exit(0);
|
||||||
else {
|
else {
|
||||||
|
Loading…
Reference in New Issue
Block a user