[systemd-devel] [PATCH 1/7] make utmp/wtmp support configurable

Emil Renner Berthing systemd at esmil.dk
Fri Sep 26 01:00:30 PDT 2014


On 26 September 2014 04:43, Zbigniew Jędrzejewski-Szmek
<zbyszek at in.waw.pl> wrote:
> On Wed, Sep 24, 2014 at 05:25:00PM +0200, Emil Renner Berthing wrote:
>> For now just stub out the functions in utmp-wtmp.h
>> so code will still compile. These stubs will be
>> removed in the last commit in this patch series.
>> ---
>>  Makefile.am                         | 34 +++++++++++++++++++++++++++-------
>>  configure.ac                        | 11 +++++++++++
>>  man/runlevel.xml                    |  3 ++-
>>  man/systemd-update-utmp.service.xml |  2 +-
>>  src/core/build.h                    |  7 +++++++
>>  src/shared/utmp-wtmp.h              | 28 ++++++++++++++++++++++++++++
>>  6 files changed, 76 insertions(+), 9 deletions(-)
> Hm, I understand why this is wanted, but the approach is rather intrusive.
> Can you instead modify utmp-wtmp.c to provide noop stubs when utmp
> is disabled? Other places should simply call the utmp_* functions as before.
> Possibly if there are other places where significant prepration is
> done before calling utmp_*, like server_forward_wall, stub implementations
> could be provided too, but only if it seems to make a significant difference
> at runtime. In general please try to minimize ifdefs, we have too many
> of those already.

This is exactly the approach taken in this first patch, except it uses
static inline stubs in the header file. This is better, since is lets the
compiler see that the functions doesn't do anything and in many
cases it can compile out more code.

The following patches may eliminate a little more useless code,
but mostly they serve to align with the ocding style in other files,
where this noop-stubbing doesn't seem to be used much.
I am totally fine with only applying this first patch.

/Emil


More information about the systemd-devel mailing list