File 0020-fabrics-sanitize-dump-config-output.patch of Package libnvme.27881

From: Martin George <marting@netapp.com>
Date: Fri, 22 Jul 2022 22:17:43 +0530
Subject: fabrics: sanitize dump-config output
Git-commit: 52de785ed250accc0d9c7e6d618e0c3754c778ff
References: git-fixes

Trivial fix to sanitize the dump-config output by appending a
new line at the end.

Signed-off-by: Martin George <marting@netapp.com>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
 src/nvme/json.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- a/src/nvme/json.c
+++ b/src/nvme/json.c
@@ -325,9 +325,10 @@ int json_update_config(nvme_root_t r, co
 			json_object_put(subsys_array);
 		json_object_array_add(json_root, host_obj);
 	}
-	if (!config_file)
+	if (!config_file) {
 		ret = json_object_to_fd(1, json_root, JSON_C_TO_STRING_PRETTY);
-	else
+		printf("\n");
+	} else
 		ret = json_object_to_file_ext(config_file, json_root,
 					      JSON_C_TO_STRING_PRETTY);
 	if (ret < 0) {
openSUSE Build Service is sponsored by