[v2,14/30] discover/powerpc: Use process_get_stdout
diff mbox series

Message ID df8f1cb124949dd57e8225030473153fc44a2175.1533230644.git.geoff@infradead.org
State Accepted
Headers show
Series
  • [v2,01/30] docker: Add libfdt-dev
Related show

Commit Message

Geoff Levand Aug. 2, 2018, 5:29 p.m. UTC
Signed-off-by: Geoff Levand <geoff@infradead.org>
---
 discover/platform-powerpc.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

Patch
diff mbox series

diff --git a/discover/platform-powerpc.c b/discover/platform-powerpc.c
index 22d213d..2ee376d 100644
--- a/discover/platform-powerpc.c
+++ b/discover/platform-powerpc.c
@@ -148,7 +148,7 @@  static int parse_nvram_params(struct platform_powerpc *platform,
 
 static int parse_nvram(struct platform_powerpc *platform)
 {
-	struct process *process;
+	struct process_stdout *stdout;
 	const char *argv[5];
 	int rc;
 
@@ -158,23 +158,17 @@  static int parse_nvram(struct platform_powerpc *platform)
 	argv[3] = partition;
 	argv[4] = NULL;
 
-	process = process_create(platform);
-	process->path = "nvram";
-	process->argv = argv;
-	process->keep_stdout = true;
+	rc = process_get_stdout_argv(NULL, &stdout, argv);
 
-	rc = process_run_sync(process);
-
-	if (rc || !process_exit_ok(process)) {
+	if (rc) {
 		fprintf(stderr, "nvram process returned "
 				"non-zero exit status\n");
 		rc = -1;
 	} else {
-		rc = parse_nvram_params(platform, process->stdout_buf,
-					    process->stdout_len);
+		rc = parse_nvram_params(platform, stdout->buf, stdout->len);
 	}
 
-	process_release(process);
+	talloc_free(stdout);
 	return rc;
 }