Blame SOURCES/0018-vdagent-Return-1-when-virtio-device-cannot-be-opened.patch

46eaa5
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
46eaa5
From: Christophe Fergeau <cfergeau@redhat.com>
46eaa5
Date: Mon, 7 Sep 2015 16:38:10 +0200
46eaa5
Subject: [PATCH] vdagent: Return '1' when virtio device cannot be opened
46eaa5
46eaa5
The vdagent process currently exits with an error code set to 0 whenn
46eaa5
the virtio device cannot be opened (for example because it's missing).
46eaa5
This is not consistent with the other failures to startup which set the
46eaa5
exit code to 1. This commit ensures 1 is returned in this situation too.
46eaa5
46eaa5
Resolves: rhbz#1256704
46eaa5
---
46eaa5
 src/vdagent.c | 3 ++-
46eaa5
 1 file changed, 2 insertions(+), 1 deletion(-)
46eaa5
46eaa5
diff --git a/src/vdagent.c b/src/vdagent.c
46eaa5
index a26af73..1336faa 100644
46eaa5
--- a/src/vdagent.c
46eaa5
+++ b/src/vdagent.c
46eaa5
@@ -238,7 +238,8 @@ int main(int argc, char *argv[])
46eaa5
             LOG_USER);
46eaa5
 
46eaa5
     if (file_test(portdev) != 0) {
46eaa5
-        return 0;
46eaa5
+        syslog(LOG_ERR, "Cannot access vdagent virtio channel %s", portdev);
46eaa5
+        return 1;
46eaa5
     }
46eaa5
 
46eaa5
     if (do_daemonize)