[libvirt PATCH v2 08/20] commandhelper: Factor out printArguments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
Reviewed-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 tests/commandhelper.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/tests/commandhelper.c b/tests/commandhelper.c
index f7e406ec83..ec54f55eb6 100644
--- a/tests/commandhelper.c
+++ b/tests/commandhelper.c
@@ -80,6 +80,15 @@ static struct Arguments *parseArguments(int argc, char** argv)
     return NULL;
 }
 
+static void printArguments(FILE *log, int argc, char** argv)
+{
+    size_t i;
+
+    for (i = 1; i < argc; i++) {
+        fprintf(log, "ARG:%s\n", argv[i]);
+    }
+}
+
 static int envsort(const void *a, const void *b)
 {
     const char *astr = *(const char**)a;
@@ -115,9 +124,7 @@ int main(int argc, char **argv) {
     if (!log || !args)
         goto cleanup;
 
-    for (i = 1; i < argc; i++) {
-        fprintf(log, "ARG:%s\n", argv[i]);
-    }
+    printArguments(log, argc, argv);
 
     for (n = 0; environ[n]; n++) {
     }
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux