Skip to content

Commit 2d9d2c4

Browse files
committed
service-constants: Add error description for SET_CAPS and SET_PRIO execution stages
This will avoid a null dereference when logging an error in those stages. Signed-off-by: Mobin Aydinfar <mobin@mobintestserver.ir>
1 parent a564425 commit 2d9d2c4

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/includes/service-constants.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,18 @@ const char * const exec_stage_descriptions[/* static_cast<int>(exec_stage::DO_EX
9696
"setting user/group ID", // SET_UIDGID
9797
"opening log file", // OPEN_LOGFILE
9898
// SPARE1 used
99-
nullptr, // SPARE2
100-
nullptr, // SPARE3
99+
#if SUPPORT_CAPABILITIES
100+
"setting capabilities", // SET_CAPS
101+
#else
102+
"", // SET_CAPS (placeholder)
103+
#endif
104+
// SPARE2 used
105+
#if SUPPORT_IOPRIO
106+
"setting I/O priority", // SET_PRIO
107+
#else
108+
"", // SET_PRIO (placeholder)
109+
#endif
110+
// SPARE3 used
101111
nullptr, // SPARE4
102112
nullptr, // SPARE5
103113
nullptr, // SPARE6

0 commit comments

Comments
 (0)