mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/3] Tools: hv: fix warnings in hv_vss_daemon
@ 2013-03-26 15:28 Olaf Hering
  2013-03-26 15:28 ` [PATCH 2/3] tools: hv: fix checks for origin of netlink message " Olaf Hering
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Olaf Hering @ 2013-03-26 15:28 UTC (permalink / raw)
  To: kys, gregkh; +Cc: linux-kernel, Olaf Hering

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>
---
 tools/hv/hv_vss_daemon.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/tools/hv/hv_vss_daemon.c b/tools/hv/hv_vss_daemon.c
index 9526995..2a03d0b 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)
 	FILE *file;
 	char *p;
 	char *x;
-	int error;
+	int error = 0;
 
 	switch (operation) {
 	case VSS_OP_FREEZE:
@@ -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');
@@ -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());
 

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-04-23 12:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-26 15:28 [PATCH 1/3] Tools: hv: fix warnings in hv_vss_daemon Olaf Hering
2013-03-26 15:28 ` [PATCH 2/3] tools: hv: fix checks for origin of netlink message " Olaf Hering
2013-03-26 18:45   ` KY Srinivasan
2013-03-26 15:28 ` [PATCH 3/3] tools: hv: use getmntent " Olaf Hering
2013-03-26 18:45   ` KY Srinivasan
2013-03-26 18:44 ` [PATCH 1/3] Tools: hv: fix warnings " KY Srinivasan
2013-04-19 23:24 ` Greg KH
2013-04-21 22:32   ` KY Srinivasan
2013-04-22  1:13     ` Greg KH
2013-04-23 12:43       ` KY Srinivasan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®