- tools: hv: Improve error logging in VSS daemon.
[opensuse:kernel-source.git] / patches.suse / msft-hv-0527-tools-hv-Improve-error-logging-in-VSS-daemon.patch
1 From: Tomas Hozza <thozza@redhat.com>
2 Date: Thu, 27 Jun 2013 13:52:47 +0200
3 Patch-mainline: v3.12-rc1
4 Subject: tools: hv: Improve error logging in VSS daemon.
5 Git-commit: 5c2892698184bf82e1f7d5c557ad81c9570b569a
6
7 Use errno and strerror() when logging errors to provide more
8 information.
9
10 Signed-off-by: Tomas Hozza <thozza@redhat.com>
11 Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
12 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 Acked-by: <ohering@suse.de>
14 ---
15  tools/hv/hv_vss_daemon.c | 10 ++++++----
16  1 file changed, 6 insertions(+), 4 deletions(-)
17
18 diff --git a/tools/hv/hv_vss_daemon.c b/tools/hv/hv_vss_daemon.c
19 index fea03a3..64112e1 100644
20 --- a/tools/hv/hv_vss_daemon.c
21 +++ b/tools/hv/hv_vss_daemon.c
22 @@ -156,7 +156,8 @@ int main(void)
23  
24         fd = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR);
25         if (fd < 0) {
26 -               syslog(LOG_ERR, "netlink socket creation failed; error:%d", fd);
27 +               syslog(LOG_ERR, "netlink socket creation failed; error:%d %s",
28 +                               errno, strerror(errno));
29                 exit(EXIT_FAILURE);
30         }
31         addr.nl_family = AF_NETLINK;
32 @@ -167,7 +168,7 @@ int main(void)
33  
34         error = bind(fd, (struct sockaddr *)&addr, sizeof(addr));
35         if (error < 0) {
36 -               syslog(LOG_ERR, "bind failed; error:%d", error);
37 +               syslog(LOG_ERR, "bind failed; error:%d %s", errno, strerror(errno));
38                 close(fd);
39                 exit(EXIT_FAILURE);
40         }
41 @@ -187,7 +188,7 @@ int main(void)
42  
43         len = netlink_send(fd, message);
44         if (len < 0) {
45 -               syslog(LOG_ERR, "netlink_send failed; error:%d", len);
46 +               syslog(LOG_ERR, "netlink_send failed; error:%d %s", errno, strerror(errno));
47                 close(fd);
48                 exit(EXIT_FAILURE);
49         }
50 @@ -241,7 +242,8 @@ int main(void)
51                 vss_msg->error = error;
52                 len = netlink_send(fd, incoming_cn_msg);
53                 if (len < 0) {
54 -                       syslog(LOG_ERR, "net_link send failed; error:%d", len);
55 +                       syslog(LOG_ERR, "net_link send failed; error:%d %s",
56 +                                       errno, strerror(errno));
57                         exit(EXIT_FAILURE);
58                 }
59         }