From d55c89690759e2e420da6834dece6274b35d23ad Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Wed, 23 Apr 2025 12:06:16 +0200 Subject: [PATCH] core: Merge forward declaration and definition of DynamicUser --- src/core/dynamic-user.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/core/dynamic-user.h b/src/core/dynamic-user.h index 3e0074defbd..fe190cb864e 100644 --- a/src/core/dynamic-user.h +++ b/src/core/dynamic-user.h @@ -8,19 +8,12 @@ #include "fdset.h" #include "memory-util.h" -typedef struct DynamicUser DynamicUser; typedef struct Manager Manager; -typedef struct DynamicCreds { - /* A combination of a dynamic user and group */ - DynamicUser *user; - DynamicUser *group; -} DynamicCreds; - /* Note that this object always allocates a pair of user and group under the same name, even if one of them isn't * used. This means, if you want to allocate a group and user pair, and they might have two different names, then you * need to allocated two of these objects. DynamicCreds below makes that easy. */ -struct DynamicUser { +typedef struct DynamicUser { Manager *manager; unsigned n_ref; @@ -29,7 +22,13 @@ struct DynamicUser { int storage_socket[2]; char name[]; -}; +} DynamicUser; + +typedef struct DynamicCreds { + /* A combination of a dynamic user and group */ + DynamicUser *user; + DynamicUser *group; +} DynamicCreds; int dynamic_user_serialize(Manager *m, FILE *f, FDSet *fds); int dynamic_user_serialize_one(DynamicUser *d, const char *key, FILE *f, FDSet *fds); -- 2.47.3