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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



EADDRINUSE usually means the socket file was left behind after a crash.

Signed-off-by: Francois Gouget <fgouget@xxxxxxxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]