]> git.ipfire.org Git - thirdparty/systemd.git/commit
core: rework how we count the n_on_console counter 7991/head
authorLennart Poettering <lennart@poettering.net>
Wed, 24 Jan 2018 18:59:55 +0000 (19:59 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 24 Jan 2018 19:14:51 +0000 (20:14 +0100)
commitadefcf2821a386184991054ed2bb6dacc90d7419
tree66efe84133b82d0bb0fde787e17a126723f12306
parentbb2c7685454842549bc1fe47adc35cbca2a84190
core: rework how we count the n_on_console counter

Let's add a per-unit boolean that tells us whether our unit is currently
counted or not. This way it's unlikely we get out of sync again and
things are generally more robust.

This also allows us to remove the counting logic specific to service
units (which was in fact mostly a copy from the generic implementation),
in favour of fully generic code.

Replaces: #7824
src/core/manager.c
src/core/manager.h
src/core/service.c
src/core/unit.c
src/core/unit.h