Merge pull request #11 from anoo1/master
Add App Set BMC Global Enables ipmi cmd
diff --git a/apphandler.C b/apphandler.C
index 132f5c6..40cd79d 100755
--- a/apphandler.C
+++ b/apphandler.C
@@ -134,8 +134,8 @@
return -1;
}
- // Start watchdog
- r = sd_bus_message_new_method_call(bus,&m,busname,objname,iface,"start");
+ // Stop the current watchdog if any
+ r = sd_bus_message_new_method_call(bus,&m,busname,objname,iface,"stop");
if (r < 0) {
fprintf(stderr, "Failed to add the start method object: %s\n", strerror(-r));
return -1;
@@ -146,6 +146,21 @@
return -1;
}
+ // Start the watchdog if requested
+ if (reqptr->t_use & 0x40)
+ {
+ r = sd_bus_message_new_method_call(bus,&m,busname,objname,iface,"start");
+ if (r < 0) {
+ fprintf(stderr, "Failed to add the start method object: %s\n", strerror(-r));
+ return -1;
+ }
+ r = sd_bus_call(bus, m, 0, &error, &reply);
+ if (r < 0) {
+ fprintf(stderr, "Failed to call the start method: %s\n", strerror(-r));
+ return -1;
+ }
+ }
+
sd_bus_error_free(&error);
sd_bus_message_unref(m);