@@ -615,7 +615,7 @@ void mDNS::runMainLoop() {
615615 }
616616 if (!name_.ends_with (" ." )) name_ += " ." ;
617617
618- MDNS_LOG << " Opened " << std::to_string (num_sockets) << " socket" << (num_sockets ? " s" : " " )
618+ MDNS_LOG << " Opened " << std::to_string (num_sockets) << " socket" << (num_sockets > 1 ? " s" : " " )
619619 << " for mDNS service\n " ;
620620 MDNS_LOG << " Service mDNS: " << name_ << " :" << port_ << " \n " ;
621621 MDNS_LOG << " Hostname: " << hostname_.data () << " \n " ;
@@ -747,7 +747,7 @@ void mDNS::runMainLoop() {
747747 for (int isock = 0 ; isock < num_sockets; ++isock) {
748748 mdns_socket_close (sockets[isock]);
749749 }
750- MDNS_LOG << " Closed socket " << (num_sockets ? " s" : " " ) << " \n " ;
750+ MDNS_LOG << " Closed socket " << (num_sockets > 1 ? " s" : " " ) << " \n " ;
751751}
752752
753753void mDNS::executeQuery (const ServiceQueries &serviceQueries) {
@@ -760,7 +760,7 @@ void mDNS::executeQuery(const ServiceQueries &serviceQueries) {
760760 MDNS_LOG << msg << " \n " ;
761761 throw std::runtime_error (msg);
762762 }
763- MDNS_LOG << " Opened " << num_sockets << " socket" << (num_sockets ? " s" : " " ) << " for mDNS query\n " ;
763+ MDNS_LOG << " Opened " << num_sockets << " socket" << (num_sockets > 1 ? " s" : " " ) << " for mDNS query\n " ;
764764
765765 size_t capacity = 2048 ;
766766 void *buffer = malloc (capacity);
@@ -828,7 +828,7 @@ void mDNS::executeQuery(const ServiceQueries &serviceQueries) {
828828 for (int isock = 0 ; isock < num_sockets; ++isock) {
829829 mdns_socket_close (sockets[isock]);
830830 }
831- MDNS_LOG << " Closed socket" << (num_sockets ? " s" : " " ) << " \n " ;
831+ MDNS_LOG << " Closed socket" << (num_sockets > 1 ? " s" : " " ) << " \n " ;
832832}
833833
834834void mDNS::executeDiscovery () {
@@ -886,7 +886,7 @@ void mDNS::executeDiscovery() {
886886 for (int isock = 0 ; isock < num_sockets; ++isock) {
887887 mdns_socket_close (sockets[isock]);
888888 }
889- MDNS_LOG << " Closed socket" << (num_sockets ? " s" : " " ) << " \n " ;
889+ MDNS_LOG << " Closed socket" << (num_sockets > 1 ? " s" : " " ) << " \n " ;
890890}
891891
892892void mDNS::runDumpMode (int *sockets, const int num_sockets) {
0 commit comments