summaryrefslogtreecommitdiffstats
path: root/discover/udev.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-03-05 13:54:55 +0800
committerGeoff Levand <geoff@infradead.org>2013-03-05 06:07:27 -0800
commitc13f929a197641ec0322fff57b4beeacb5338380 (patch)
treeb1fe2d88480202af3beac5ec0dd6fae6c5a0a7e5 /discover/udev.c
parentc0a0d427bdc0cf18940874e9aa34006da98d10a1 (diff)
downloadtalos-petitboot-c13f929a197641ec0322fff57b4beeacb5338380.tar.gz
talos-petitboot-c13f929a197641ec0322fff57b4beeacb5338380.zip
discover: Use pb_run_cmd rather than calling system()
Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
Diffstat (limited to 'discover/udev.c')
-rw-r--r--discover/udev.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/discover/udev.c b/discover/udev.c
index a5d9e03..fb64221 100644
--- a/discover/udev.c
+++ b/discover/udev.c
@@ -13,6 +13,7 @@
#include <log/log.h>
#include <talloc/talloc.h>
#include <waiter/waiter.h>
+#include <system/system.h>
#include "event.h"
#include "udev.h"
@@ -156,7 +157,16 @@ out_err:
int udev_trigger(struct udev __attribute__((unused)) *udev)
{
- int rc = system("/sbin/udevadm trigger --subsystem-match=block --action=add");
+ const char *cmd[] = {
+ "/sbin/udevadm,
+ "trigger",
+ "--subsystem-match=block",
+ "--action=add",
+ NULL,
+ };
+ int rc;
+
+ rc = pb_run_cmd(cmd, 1, 0);
if (rc)
pb_log("udev trigger failed: %d (%d)\n", rc, WEXITSTATUS(rc));
OpenPOWER on IntegriCloud