summaryrefslogtreecommitdiffstats
path: root/bmcctl
diff options
context:
space:
mode:
authorAndrew Geissler <andrewg@us.ibm.com>2016-11-17 13:43:37 -0600
committerAndrew Geissler <andrewg@us.ibm.com>2016-11-17 13:43:37 -0600
commitdfda936510a56421370267ef5fc54b10b739c67c (patch)
treee3092b448720d38dc202ce21fd37aa8355fbf0dc /bmcctl
parentaab61990a8eda4c5343e92999d461993f0840213 (diff)
downloadtalos-skeleton-dfda936510a56421370267ef5fc54b10b739c67c.tar.gz
talos-skeleton-dfda936510a56421370267ef5fc54b10b739c67c.zip
Use system call to issue warmReset command
We hit intermittent problems with the existing g_spawn_command_line_async() call. Lets just keep it nice and simple with a system call. This will be refactored in story 783 this sprint. Partially resolves openbmc/openbmc#519 Change-Id: I545578a24e44cd73461af47c6074a618c0d2bad4 Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
Diffstat (limited to 'bmcctl')
-rw-r--r--bmcctl/control_bmc_obj.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/bmcctl/control_bmc_obj.c b/bmcctl/control_bmc_obj.c
index c0135c4..a7a3e73 100644
--- a/bmcctl/control_bmc_obj.c
+++ b/bmcctl/control_bmc_obj.c
@@ -22,19 +22,10 @@ static gboolean on_warm_reset(ControlBmc *bmc,
GDBusMethodInvocation *invocation,
gpointer user_data)
{
- GError *err = NULL;
/* Wait a while before reboot, so the caller can be responded.
- * Note that g_spawn_command_line_async() cannot parse ';' as
- * a command separator. Need to use 'sh -c' to let shell parse it.
*/
- gchar *reboot_command = "/bin/sh -c 'sleep 3;reboot'";
-
- g_spawn_command_line_async(reboot_command, &err);
- if (err != NULL)
- {
- fprintf(stderr, "warmReset() error: %s\n", err->message);
- g_error_free(err);
- }
+ const char *reboot_command = "/bin/sh -c 'sleep 3;reboot'&";
+ system(reboot_command);
control_bmc_complete_warm_reset(bmc, invocation);
return TRUE;
OpenPOWER on IntegriCloud