diff contrib/chg/hgclient.c @ 28769:222f482930c8

chg: make connect debug message less repetitive Before this patch, "connect to" debug message is printed repeatedly because a previous patch changed how the chg client decides the server is ready to be connected. This patch revises the places we print connect debug messages so they are less repetitive without losing useful information.
author Jun Wu <quark@fb.com>
date Mon, 04 Apr 2016 02:36:05 +0100
parents 8e5312f8df30
children 7f6e0a15189b
line wrap: on
line diff
--- a/contrib/chg/hgclient.c	Mon Apr 04 03:17:59 2016 +0100
+++ b/contrib/chg/hgclient.c	Mon Apr 04 02:36:05 2016 +0100
@@ -429,7 +429,6 @@
 	strncpy(addr.sun_path, sockname, sizeof(addr.sun_path));
 	addr.sun_path[sizeof(addr.sun_path) - 1] = '\0';
 
-	debugmsg("connect to %s", addr.sun_path);
 	int r = connect(fd, (struct sockaddr *)&addr, sizeof(addr));
 	if (r < 0) {
 		close(fd);
@@ -438,6 +437,7 @@
 		abortmsg("cannot connect to %s (errno = %d)",
 			 addr.sun_path, errno);
 	}
+	debugmsg("connected to %s", addr.sun_path);
 
 	hgclient_t *hgc = mallocx(sizeof(hgclient_t));
 	memset(hgc, 0, sizeof(*hgc));