mirror of
https://github.com/troglobit/finit.git
synced 2026-10-27 12:20:54 +00:00
Store removal status separate from dirty
Having removal status stored in the dirty status resulted in removal status being forgotten when a service was marked as dirty, for instance when a dependency was updated. This side effect of marke_dirty seems a bit unexpected and instead of adding exceptions to the logic for when marking a service dirty - let's separate the two things (dirty and removed) from each other. Signed-off-by: Jacques de Laval <Jacques.De.Laval@westermo.com>
This commit is contained in:
1 parent
d00a53dfbf
commit
b3fad1077e
3 files changed
+13
-4
No files matched your search
@@ -106,7 +106,8 @@ typedef struct svc {
|
||||
const svc_state_t state; /* Paused, Reloading, Restart, Running, ... */
|
||||
svc_type_t type; /* Service, run, task, ... */
|
||||
int protect; /* Services like dbus-daemon & udev by Finit */
|
||||
const int dirty; /* -1: removal, 0: unmodified, 1: modified */
|
||||
const int dirty; /* 0: unmodified, 1: modified */
|
||||
const int removed;
|
||||
int starting; /* ... waiting for pidfile to be re-asserted */
|
||||
int runlevels;
|
||||
int sighup; /* This service supports SIGHUP :) */
|
||||
@@ -179,6 +180,7 @@ void svc_clean_dynamic (void (*cb)(svc_t *));
|
||||
int svc_clean_bootstrap (svc_t *svc);
|
||||
void svc_prune_bootstrap (void);
|
||||
|
||||
void svc_enable (svc_t *svc);
|
||||
int svc_enabled (svc_t *svc);
|
||||
int svc_is_unique (svc_t *svc);
|
||||
|
||||
@@ -197,7 +199,7 @@ static inline void svc_starting (svc_t *svc) { if (svc) svc->starting = 1;
|
||||
static inline void svc_started (svc_t *svc) { if (svc) svc->starting = 0; }
|
||||
static inline int svc_is_starting (svc_t *svc) { return svc && 0 != svc->starting; }
|
||||
|
||||
static inline int svc_is_removed (svc_t *svc) { return svc && -1 == svc->dirty; }
|
||||
static inline int svc_is_removed (svc_t *svc) { return svc && svc->removed; }
|
||||
static inline int svc_is_changed (svc_t *svc) { return svc && 0 != svc->dirty; }
|
||||
static inline int svc_is_updated (svc_t *svc) { return svc && 1 == svc->dirty; }
|
||||
|
||||
|
||||
Reference in new issue
Block a user