# \[MDADM PATCH 1/1\] Add detail information when can not connect monitor

- From: Xiao Ni \<hidden\>
- Date: 2017-01-08 02:59:54 
- List: linux-raid
- Page: https://ratatoskr.run/linux-raid/2017/01/6634094
- Thread: https://ratatoskr.run/linux-raid/2017/01/6634094/t.md

```text
If it can't connect monitor, now the error message is just
Error waiting for xxx to be clean. Add detail error message
in connect_monitor.

Suggested-by: Oleg Samarin <redacted>
Signed-off-by: Xiao Ni <redacted>
---
 msg.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/msg.c b/msg.c
index 45cd450..c66b0a1 100644
--- a/msg.c
+++ b/msg.c
@@ -171,6 +171,8 @@ int connect_monitor(char *devname)
 	addr.sun_family = PF_LOCAL;
 	strcpy(addr.sun_path, path);
 	if (connect(sfd, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
+		pr_err("Error connecting monitor with %s: %s\n",
+			addr.sun_path, strerror(errno));
 		close(sfd);
 		return -1;
 	}
-- 
2.7.4

```
