Follow-up Comment #28, bug #15559 (project freeciv):

>> "IPv4 bind failed: Address already in use"
> Print that particular error message only if also IPv6 bind failed?

To be exact, print no error messages if we can listen() to at least one
socket?

OpenBSD 'man getaddrinfo' shows an example of this:



           for (res = res0; res && nsock < MAXSOCK; res = res->ai_next) {
                   s[nsock] = socket(res->ai_family, res->ai_socktype,
                       res->ai_protocol);
                   if (s[nsock] == -1) {
                           cause = "socket";
                           continue;
                   }

                   if (bind(s[nsock], res->ai_addr, res->ai_addrlen) == -1)
{
                           cause = "bind";
                           save_errno = errno;
                           close(s[nsock]);
                           errno = save_errno;
                           continue;
                   }
                   (void) listen(s[nsock], 5);

                   nsock++;
           }
           if (nsock == 0)
                   err(1, "%s", cause);



Other programs had no 'cause' variable and no 'save_errno' stuff around
close(), but they kept the idea to ignore errors if they listen() to at least
one socket.

The old Freeciv code printed every error that happens. When I made the
plural-listen patch, I tried to preserve the old code, so it alarmingly
prints every error that happens!

So someone must decide whether to print no error messages if Freeciv can
listen() to at least one socket.

    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?15559>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to