[Spice-devel] [vd_agent] vdagentd: Make the 'could not create server socket' message more helpful

Christophe Fergeau cfergeau at redhat.com
Mon Nov 7 17:48:04 UTC 2016


Acked-by: Christophe Fergeau <cfergeau at redhat.com>

On Wed, Nov 02, 2016 at 04:36:40PM +0100, Francois Gouget wrote:
> EADDRINUSE usually means the socket file was left behind after a crash.
> 
> Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
> ---
>  src/vdagentd/vdagentd.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/src/vdagentd/vdagentd.c b/src/vdagentd/vdagentd.c
> index 8dee414..13a84ce 100644
> --- a/src/vdagentd/vdagentd.c
> +++ b/src/vdagentd/vdagentd.c
> @@ -970,8 +970,13 @@ int main(int argc, char *argv[])
>                                   vdagentd_messages, VDAGENTD_NO_MESSAGES,
>                                   debug);
>      if (!server) {
> -        syslog(LOG_CRIT, "Fatal could not create server socket %s",
> -               vdagentd_socket);
> +        if (errno == EADDRINUSE) {
> +            syslog(LOG_CRIT, "Fatal the server socket %s exists already. Delete it?",
> +                   vdagentd_socket);
> +        } else {
> +            syslog(LOG_CRIT, "Fatal could not create the server socket %s: %m",
> +                   vdagentd_socket);
> +        }
>          return 1;
>      }
>      if (chmod(vdagentd_socket, 0666)) {
> -- 
> 2.10.1
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20161107/f9c6bdae/attachment.sig>


More information about the Spice-devel mailing list