Skip to content

Commit

Permalink
Tools: hv: fix warnings in hv_vss_daemon
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: K. Y. Srinivasan <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
olafhering authored and gregkh committed Apr 24, 2013
1 parent 9809785 commit eb8905b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tools/hv/hv_vss_daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static int vss_operate(int operation)
FILE *file;
char *p;
char *x;
int error;
int error = 0;

switch (operation) {
case VSS_OP_FREEZE:
Expand All @@ -60,11 +60,13 @@ static int vss_operate(int operation)
case VSS_OP_THAW:
fs_op = "-u ";
break;
default:
return -1;
}

file = popen("mount | awk '/^\/dev\// { print $3}'", "r");
file = popen("mount | awk '/^\\/dev\\// { print $3}'", "r");
if (file == NULL)
return;
return -1;

while ((p = fgets(buf, sizeof(buf), file)) != NULL) {
x = strchr(p, '\n');
Expand Down Expand Up @@ -128,7 +130,9 @@ int main(void)
int op;
struct hv_vss_msg *vss_msg;

daemon(1, 0);
if (daemon(1, 0))
return 1;

openlog("Hyper-V VSS", 0, LOG_USER);
syslog(LOG_INFO, "VSS starting; pid is:%d", getpid());

Expand Down

0 comments on commit eb8905b

Please sign in to comment.