From: Jelte Jansen Date: Tue, 4 Dec 2012 17:34:59 +0000 (-0800) Subject: [2445] Make sure buffer is flushed in dhcp[46] stand-alone X-Git-Tag: bind10-1.0.0-beta-release~19^2~17^2~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38db6aff7d759e5f271cf0d369459b361c8e60a7;p=thirdparty%2Fkea.git [2445] Make sure buffer is flushed in dhcp[46] stand-alone even when -s was not given but it reverts to standalone because of a session error --- diff --git a/src/bin/dhcp4/main.cc b/src/bin/dhcp4/main.cc index 4bf55ea4d6..45f1de1612 100644 --- a/src/bin/dhcp4/main.cc +++ b/src/bin/dhcp4/main.cc @@ -17,6 +17,7 @@ #include #include #include +#include #include @@ -113,6 +114,10 @@ main(int argc, char* argv[]) { LOG_ERROR(dhcp4_logger, DHCP4_SESSION_FAIL).arg(ex.what()); // Let's continue. It is useful to have the ability to run // DHCP server in stand-alone mode, e.g. for testing + // We do need to make sure logging is no longer buffered + // since then it would not print until dhcp6 is stopped + isc::log::LoggerManager log_manager; + log_manager.process(); } } else { LOG_DEBUG(dhcp4_logger, DBG_DHCP4_START, DHCP4_STANDALONE); diff --git a/src/bin/dhcp6/main.cc b/src/bin/dhcp6/main.cc index 501a00a876..ced7422923 100644 --- a/src/bin/dhcp6/main.cc +++ b/src/bin/dhcp6/main.cc @@ -17,6 +17,7 @@ #include #include #include +#include #include @@ -122,6 +123,10 @@ main(int argc, char* argv[]) { LOG_ERROR(dhcp6_logger, DHCP6_SESSION_FAIL).arg(ex.what()); // Let's continue. It is useful to have the ability to run // DHCP server in stand-alone mode, e.g. for testing + // We do need to make sure logging is no longer buffered + // since then it would not print until dhcp6 is stopped + isc::log::LoggerManager log_manager; + log_manager.process(); } } else { LOG_DEBUG(dhcp6_logger, DBG_DHCP6_START, DHCP6_STANDALONE);