Skip to contentSkip to conversation

master - scripts: lvm2-activation-generator: also log possible execv error

PATCH Peter Rajnoha 1 participant 1 message Aug 30, 2018

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=03ed2aae3a54afcc521a1af9b8a62827c1fb76d6
Commit:        03ed2aae3a54afcc521a1af9b8a62827c1fb76d6
Parent:        3d5c4847b663c42573ffabba7f26f30196f54d82
Author:        Peter Rajnoha <[email protected]>
AuthorDate:    Thu Aug 30 12:48:50 2018 +0200
Committer:     Peter Rajnoha <[email protected]>
CommitterDate: Thu Aug 30 13:14:10 2018 +0200

scripts: lvm2-activation-generator: also log possible execv error

---
 scripts/generator-internals.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
scripts/generator-internals.c +2 -1
index c38323b..00a15e5 100644
@@ -56,7 +56,8 @@ static bool _open_child(struct child_process *child, const char *cmd, const char
 			close(pipe_fd[1]);
 		}
 
-		execv(cmd, (char *const *) argv);
+		if (execv(cmd, (char *const *) argv) < 0)
+			_error("execv failed: %s\n", strerror(errno));
 		// Shouldn't get here unless exec failed.
 		exit(1);
 	} else {