- tools: hv: Improve error logging in VSS daemon.
[opensuse:kernel-source.git] / patches.suse / msft-hv-0536-Tools-hv-check-return-value-of-system-in-hv_kvp_daem.patch
1 From: Olaf Hering <olaf@aepfle.de>
2 Date: Sun, 4 Aug 2013 16:40:44 +0200
3 Patch-mainline: v3.12-rc1
4 Subject: Tools: hv: check return value of system in hv_kvp_daemon
5 Git-commit: d3b688c6622334e8460e808755d7d9c4a78c3ae5
6
7 hv_kvp_daemon.c: In function 'main':
8 hv_kvp_daemon.c:1441:8: warning: ignoring return value of 'daemon', declared with attribute warn_unused_result [-Wunused-result]
9
10 Signed-off-by: Olaf Hering <olaf@aepfle.de>
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_kvp_daemon.c | 6 +++++-
16  1 file changed, 5 insertions(+), 1 deletion(-)
17
18 diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c
19 index ba075e5..b96eccc 100644
20 --- a/tools/hv/hv_kvp_daemon.c
21 +++ b/tools/hv/hv_kvp_daemon.c
22 @@ -1353,7 +1353,11 @@ setval_done:
23          */
24  
25         snprintf(cmd, sizeof(cmd), "%s %s", "hv_set_ifconfig", if_file);
26 -       system(cmd);
27 +       if (system(cmd)) {
28 +               syslog(LOG_ERR, "Failed to execute cmd '%s'; error: %d %s",
29 +                               cmd, errno, strerror(errno));
30 +               return HV_E_FAIL;
31 +       }
32         return 0;
33  
34  setval_error: