diff options
author | Olaf Hering <olaf@aepfle.de> | 2013-04-24 10:48:48 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-24 12:02:35 -0400 |
commit | eb8905b8ff4a887901779504d2ede95dc072bb16 (patch) | |
tree | 03e0aab408a3225010410f6702886130d3f7275b /tools/hv | |
parent | 98097858ccf34367905067ce0af2e6d1fab27241 (diff) |
Tools: hv: fix warnings in hv_vss_daemon
This change fixes a few compile errors:
hv_vss_daemon.c:64:15: warning: unknown escape sequence '\/'
hv_vss_daemon.c:64:15: warning: unknown escape sequence '\/'
hv_vss_daemon.c: In function 'vss_operate':
hv_vss_daemon.c:66: warning: 'return' with no value, in function returning non-void
hv_vss_daemon.c: In function 'main':
hv_vss_daemon.c:130: warning: ignoring return value of 'daemon', declared with attribute warn_unused_result
hv_vss_daemon.c: In function 'vss_operate':
hv_vss_daemon.c:47: warning: 'fs_op' may be used uninitialized in this function
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/hv')
-rw-r--r-- | tools/hv/hv_vss_daemon.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/hv/hv_vss_daemon.c b/tools/hv/hv_vss_daemon.c index 95269952aa92..2a03d0b4e213 100644 --- a/tools/hv/hv_vss_daemon.c +++ b/tools/hv/hv_vss_daemon.c | |||
@@ -51,7 +51,7 @@ static int vss_operate(int operation) | |||
51 | FILE *file; | 51 | FILE *file; |
52 | char *p; | 52 | char *p; |
53 | char *x; | 53 | char *x; |
54 | int error; | 54 | int error = 0; |
55 | 55 | ||
56 | switch (operation) { | 56 | switch (operation) { |
57 | case VSS_OP_FREEZE: | 57 | case VSS_OP_FREEZE: |
@@ -60,11 +60,13 @@ static int vss_operate(int operation) | |||
60 | case VSS_OP_THAW: | 60 | case VSS_OP_THAW: |
61 | fs_op = "-u "; | 61 | fs_op = "-u "; |
62 | break; | 62 | break; |
63 | default: | ||
64 | return -1; | ||
63 | } | 65 | } |
64 | 66 | ||
65 | file = popen("mount | awk '/^\/dev\// { print $3}'", "r"); | 67 | file = popen("mount | awk '/^\\/dev\\// { print $3}'", "r"); |
66 | if (file == NULL) | 68 | if (file == NULL) |
67 | return; | 69 | return -1; |
68 | 70 | ||
69 | while ((p = fgets(buf, sizeof(buf), file)) != NULL) { | 71 | while ((p = fgets(buf, sizeof(buf), file)) != NULL) { |
70 | x = strchr(p, '\n'); | 72 | x = strchr(p, '\n'); |
@@ -128,7 +130,9 @@ int main(void) | |||
128 | int op; | 130 | int op; |
129 | struct hv_vss_msg *vss_msg; | 131 | struct hv_vss_msg *vss_msg; |
130 | 132 | ||
131 | daemon(1, 0); | 133 | if (daemon(1, 0)) |
134 | return 1; | ||
135 | |||
132 | openlog("Hyper-V VSS", 0, LOG_USER); | 136 | openlog("Hyper-V VSS", 0, LOG_USER); |
133 | syslog(LOG_INFO, "VSS starting; pid is:%d", getpid()); | 137 | syslog(LOG_INFO, "VSS starting; pid is:%d", getpid()); |
134 | 138 | ||