diff options
Diffstat (limited to 'src/libs6rc/s6rc_service_common.c')
-rw-r--r-- | src/libs6rc/s6rc_service_common.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/libs6rc/s6rc_service_common.c b/src/libs6rc/s6rc_service_common.c index f3146be..8cbf839 100644 --- a/src/libs6rc/s6rc_service_common.c +++ b/src/libs6rc/s6rc_service_common.c @@ -4,16 +4,10 @@ #include <s6-rc/db.h> -s6rc_common_t const *s6rc_service_common (s6rc_db_t const *db, s6rc_sid_t const *id) +s6rc_common_t const *s6rc_service_common (s6rc_db_t const *db, uint32_t id) { - uint32_t i = id->i + (id->param ? db->n[id->stype] : 0) ; - switch (id->stype) - { - case STYPE_LONGRUN : return &db->longruns[i].common ; - case STYPE_ONESHOT : return &db->oneshots[i].common ; - case STYPE_EXTERNAL : return &db->externals[i].common ; - case STYPE_BUNDLE : return &db->bundles[i].common ; - case STYPE_VIRTUAL : return &db->virtuals[i].common ; - default : return 0 ; - } + uint32_t num ; + uint8_t type ; + s6rc_service_typenum(db->n, id, &type, &num) ; + return s6rc_service_common_tn(db, type, num) ; } |