ha/service-mgmt
M. Vefa Bicakci ff9e32bb80 sm_process_death: Avoid redefinition errors due to kernel headers
Prior to the v5.10-based StarlingX kernel, the "#ifdef CONFIG_SIGEXIT"
guard in prctl.h would require the user-space to either define the
CONFIG_SIGEXIT macro, or define the PR_DO_NOTIFY_TASK_STATE macro *and*
the task_state_notify_info structure to avoid build failures. The
service manager code had taken the latter approach.

Now that the prctl.h header file has been fixed in the v5.10-based
kernel to not guard these user-space APIs with "#ifdef CONFIG_SIGEXIT",
the service manager is encountering the following compilation errors:

  sm_process_death.c:49:8: error: redefinition of \
    'struct task_state_notify_info'
   struct task_state_notify_info
          ^
  In file included from /usr/include/sys/prctl.h:22:0,
                   from sm_process_death.c:18:
  /usr/include/linux/prctl.h:76:8: error: previous definition of \
    'struct task_state_notify_info'
   struct task_state_notify_info {
          ^

This commit avoids these errors by detecting whether the
PR_DO_NOTIFY_TASK_STATE macro has already been defined, which ought to
preserve backwards compatibility with older StarlingX kernels.

Story: 2008921

Change-Id: I0c28fe8b3d314931583462a3377f81ec0ca1f630
Signed-off-by: M. Vefa Bicakci <vefa.bicakci@windriver.com>
2021-07-13 16:11:25 -04:00
..
sm sm_process_death: Avoid redefinition errors due to kernel headers 2021-07-13 16:11:25 -04:00
sm-common Merge "libsm_watchdog_nfs: add missing dependency on libsm_common.so" 2021-07-07 21:18:16 +00:00
sm-db Fix SQLite3 concurrent access issue 2021-03-18 11:08:27 -04:00
LICENSE StarlingX open source release updates 2018-05-31 07:36:26 -07:00