Browse Source

control-datatypes: add srvstate_t

helican 6 months ago
parent
commit
43103f2d20
2 changed files with 4 additions and 1 deletions
  1. 1 0
      src/includes/control-datatypes.h
  2. 3 1
      src/includes/service-constants.h

+ 1 - 0
src/includes/control-datatypes.h

@@ -14,6 +14,7 @@ namespace dinit_cptypes {
     using srvname_len_t = uint16_t;
     using envvar_len_t = uint16_t;
     using sig_num_t = int;
+    using srvstate_t = uint8_t;
 } // namespace dinit_cptypes
 
 #endif

+ 3 - 1
src/includes/service-constants.h

@@ -3,8 +3,10 @@
 
 #include <mconfig.h>
 
+#include <control-datatypes.h>
+
 /* Service states */
-enum class service_state_t {
+enum class service_state_t :dinit_cptypes::srvstate_t {
     STOPPED,    // service is not running.
     STARTING,   // service is starting, and will start (or fail to start) in time.
     STARTED,    // service is running,