Fix mtce compiling issue with gcc8

Remove superfluous 'const' to fix error:
  "type qualifiers ignored on cast result type
   [-Werror=ignored-qualifiers]"

Update the usage of 'operater++' on type of 'bool'
to fix error:
  "use of an operand of type 'bool' in 'operator++'
   is deprecated [-Werror=deprecated]"

Change-Id: I0ce7b2d48f8365f1dcc23eb48e4c5148db817630
Story: 2007506
Task: 39279
Signed-off-by: Angie Wang <angie.wang@windriver.com>
This commit is contained in:
Angie Wang 2021-02-24 17:15:54 -06:00
parent 5619e3e8b6
commit 0a102143e9
2 changed files with 9 additions and 8 deletions

View File

@ -57,16 +57,16 @@ using namespace std;
#include "hostwMsg.h" /* message format */
/* Configuration Files */
#define HOSTWD_CONFIG_FILE ((const char * const)"/etc/mtc/hostwd.conf")
#define PMOND_CONFIG_FILE ((const char * const)"/etc/mtc/pmond.conf")
#define HOSTWD_CONFIG_FILE ((const char *)"/etc/mtc/hostwd.conf")
#define PMOND_CONFIG_FILE ((const char *)"/etc/mtc/pmond.conf")
/* kernel SysRq control interface file used to enable the magic SysRq key.
* Used to ensure that the SysRq service is enabled when needed. */
#define SYSRQ_CONTROL_INTERFACE ((const char * const)"/proc/sys/kernel/sysrq")
#define SYSRQ_CONTROL_INTERFACE ((const char *)"/proc/sys/kernel/sysrq")
/* kernel SysRq trigger interface file used to trigger a SysRq command.
* commands @ https://www.kernel.org/doc/html/latest/admin-guide/sysrq.html */
#define SYSRQ_COMMAND_INTERFACE ((const char * const)"/proc/sysrq-trigger")
#define SYSRQ_COMMAND_INTERFACE ((const char *)"/proc/sysrq-trigger")
#define HOSTW_MIN_KERN_UPDATE_PERIOD 5 /* user can set how long until kernel
* watchdog panics, down to this

View File

@ -188,7 +188,7 @@ void manage_quorum_failed ( void )
* by clearing the control boolean that prevents recovery. */
ilog ("Quorum failed but all reboot/reset recovery options disabled");
ilog ("... allowing auto recovery");
ctrl_ptr->quorum_failed = 0 ;
ctrl_ptr->quorum_failed = false ;
ctrl_ptr->pmon_grace_loops = config_ptr->hostwd_failure_threshold ;
}
}
@ -285,7 +285,7 @@ void hostw_service ( void )
pmonTimer.ring = false ;
}
}
else if ( ctrl->quorum_failed == 0 )
else if ( ctrl->quorum_failed == false )
{
if (FD_ISSET(hostw_socket->status_sock, &(hostw_socket->readfds)))
{
@ -304,13 +304,14 @@ void hostw_service ( void )
}
}
else if ( rc != RETRY )
ctrl->quorum_failed++ ;
ctrl->quorum_failed = true ;
}
}
if ( 0 >= ctrl->pmon_grace_loops )
{
if ( ctrl->quorum_failed++ == 0 )
if ( ctrl->quorum_failed == false )
{
ctrl->quorum_failed = true ;
if (daemon_is_file_present(NODE_LOCKED_FILE))
{
wlog( "Host watchdog (hostwd) not receiving messages from PMON"