Add detail information when can not connect monitor

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 <osamarin68@gmail.com>
Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
This commit is contained in:
Xiao Ni 2017-01-08 10:59:54 +08:00 committed by Jes Sorensen
parent d3c1141658
commit 4515fb28a5
1 changed files with 2 additions and 0 deletions

2
msg.c
View File

@ -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;
}