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

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,
                   if (s[nsock] == -1) {
                           cause = "socket";

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

           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:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to