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

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Fri Sep 26 04:50:41 PDT 2014


On Fri, Sep 26, 2014 at 10:00:30AM +0200, Emil Renner Berthing wrote:
> 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.
OK, I pushed 1/7 with some small changes. Most people are still going to compile
with utmp support, though.

Zbyszek


More information about the systemd-devel mailing list