[memprof: 61/76] server.c: Print the socket error to the terminal



commit 9efe571ae622e21b439798eb5ad709b8c29f9bf4
Author: Holger Hans Peter Freyther <zecke selfish org>
Date:   Mon Jan 18 06:24:46 2010 +0100

    server.c: Print the socket error to the terminal
    
    Print a message in all cases we are retrying the operation. This
    is a useful hint to the user what lead to the "Too many retries.."

 src/server.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/server.c b/src/server.c
index d771a4a..3e10b5f 100644
--- a/src/server.c
+++ b/src/server.c
@@ -418,10 +418,11 @@ create_control_socket (MPServer *server)
 		}
 
 	} else if (errno == ENOENT) {
-		if (mkdir (tmpdir, 0700) != 0) { 
-			if (errno == EEXIST)
+		if (mkdir (tmpdir, 0700) != 0) {
+			if (errno == EEXIST) {
+				g_warning ("memprof: '%s' tmpdir already exists.\n", tmpdir);
 				goto retry;
-			else
+			} else
 				fatal ("memprof: Cannot create %s, %d", tmpdir, g_strerror (errno));
 		}
 	} else
@@ -445,9 +446,10 @@ create_control_socket (MPServer *server)
 		addrlen = sizeof(addr);
 
 	if (bind (server->socket_fd, (struct sockaddr *)&addr, addrlen) < 0) {
-		if (errno == EADDRINUSE)
+		if (errno == EADDRINUSE) {
+                        g_warning ("memprof: Binding failed in '%s' with address in use.\n", addr.sun_path);
 			goto retry;
-		else
+		} else
 			fatal ("bind: %s\n", g_strerror (errno));
 	}
 



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