]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/core/service.c
tree-wide: use IN_SET where possible
[thirdparty/systemd.git] / src / core / service.c
index 1a4455bd2282b4863c2b74b263710f7f06b95689..fb8a970a27c78a9d5b269619549064bd503e0dce 100644 (file)
@@ -529,7 +529,7 @@ static int service_verify(Service *s) {
         if (s->bus_name && s->type != SERVICE_DBUS)
                 log_unit_warning(UNIT(s), "Service has a D-Bus service name specified, but is not of type dbus. Ignoring.");
 
-        if (s->exec_context.pam_name && !(s->kill_context.kill_mode == KILL_CONTROL_GROUP || s->kill_context.kill_mode == KILL_MIXED)) {
+        if (s->exec_context.pam_name && !IN_SET(s->kill_context.kill_mode, KILL_CONTROL_GROUP, KILL_MIXED)) {
                 log_unit_error(UNIT(s), "Service has PAM enabled. Kill mode must be set to 'control-group' or 'mixed'. Refusing.");
                 return -EINVAL;
         }
@@ -2224,7 +2224,7 @@ static int service_reload(Unit *u) {
 
         assert(s);
 
-        assert(s->state == SERVICE_RUNNING || s->state == SERVICE_EXITED);
+        assert(IN_SET(s->state, SERVICE_RUNNING, SERVICE_EXITED));
 
         service_enter_reload(s);
         return 1;
@@ -2755,7 +2755,7 @@ static int service_retry_pid_file(Service *s) {
         int r;
 
         assert(s->pid_file);
-        assert(s->state == SERVICE_START || s->state == SERVICE_START_POST);
+        assert(IN_SET(s->state, SERVICE_START, SERVICE_START_POST));
 
         r = service_load_pid_file(s, false);
         if (r < 0)
@@ -2826,7 +2826,7 @@ static int service_dispatch_io(sd_event_source *source, int fd, uint32_t events,
 
         assert(s);
         assert(fd >= 0);
-        assert(s->state == SERVICE_START || s->state == SERVICE_START_POST);
+        assert(IN_SET(s->state, SERVICE_START, SERVICE_START_POST));
         assert(s->pid_file_pathspec);
         assert(path_spec_owns_inotify_fd(s->pid_file_pathspec, fd));