• Radostin Stoyanov's avatar
    util: Don't log errno on bad server address · ee2916a5
    Radostin Stoyanov authored
    From man inet_pton(3):
    
        inet_pton() returns 1 on success (network address was successfully
        converted). 0 is returned if src does not contain a character
        string representing a valid network address in the specified
        address family. If af does not contain a valid address family,
        -1 is returned and errno is set to EAFNOSUPPORT.
    
    We can assume that the return value is 1 or 0 (because af is set to
    AF_INET4 or AF_INET6), therefore errno will not be set.
    
    If a user attempts to bind a server using invalid network address the
    following error message will be shown:
    
     Bad server address: Success
    
    Which is not very clear, with this change the error message will look
    like this:
    
    Invalid server address "localhost". The address must be in IPv4 or IPv6 format.
    Signed-off-by: 's avatarRadostin Stoyanov <rstoyanov1@gmail.com>
    ee2916a5
Name
Last commit
Last update
Documentation Loading commit data...
compel Loading commit data...
contrib Loading commit data...
coredump Loading commit data...
crit Loading commit data...
criu Loading commit data...
images Loading commit data...
include/common Loading commit data...
lib Loading commit data...
scripts Loading commit data...
soccr Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
INSTALL.md Loading commit data...
Makefile Loading commit data...
Makefile.compel Loading commit data...
Makefile.config Loading commit data...
Makefile.install Loading commit data...
Makefile.versions Loading commit data...
README.md Loading commit data...