]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
8 years agoMerge pull request #1419 from keszybz/shell-completion
Lennart Poettering [Wed, 30 Sep 2015 20:32:09 +0000 (22:32 +0200)] 
Merge pull request #1419 from keszybz/shell-completion

Shell completion tweaks

8 years agoMerge pull request #1424 from evverx/journalctl-rotate
Lennart Poettering [Wed, 30 Sep 2015 20:25:36 +0000 (22:25 +0200)] 
Merge pull request #1424 from evverx/journalctl-rotate

journalctl: add --rotate option

8 years agoman: journalctl: add info about --rotate 1424/head
Evgeny Vereshchagin [Wed, 30 Sep 2015 20:02:58 +0000 (23:02 +0300)] 
man: journalctl: add info about --rotate

8 years agoshell-completion: journalctl: add --rotate
Evgeny Vereshchagin [Wed, 30 Sep 2015 19:58:05 +0000 (22:58 +0300)] 
shell-completion: journalctl: add --rotate

8 years agojournalctl: add --rotate option
Evgeny Vereshchagin [Wed, 30 Sep 2015 19:54:58 +0000 (22:54 +0300)] 
journalctl: add --rotate option

shortcut for `systemctl kill --kill-who main --signal SIGUSR2 systemd-journald`

8 years agoMerge pull request #1421 from keszybz/formatting-fixes
Daniel Mack [Wed, 30 Sep 2015 16:40:57 +0000 (18:40 +0200)] 
Merge pull request #1421 from keszybz/formatting-fixes

logind: avoid a dot before parenthesis

8 years agoMerge pull request #1420 from keszybz/doc-updates
Daniel Mack [Wed, 30 Sep 2015 16:37:18 +0000 (18:37 +0200)] 
Merge pull request #1420 from keszybz/doc-updates

Doc updates

8 years agoNEWS: typos 1420/head
Zbigniew Jędrzejewski-Szmek [Wed, 30 Sep 2015 15:48:33 +0000 (11:48 -0400)] 
NEWS: typos

8 years agoman: update description of exit.target
Zbigniew Jędrzejewski-Szmek [Wed, 30 Sep 2015 15:14:32 +0000 (11:14 -0400)] 
man: update description of exit.target

exit.target is now used for both system and user sessions,
so remove "on user service manager exit". Also reword that
paragraph: services will be killed before the manager exits,
even if they do not conflict with shutdown target, but we
recommend that they conflict with shutdown target so that
systemd schedules them to be stopped immediately when starting
to exit.

In the first paragraph, containers should be mentioned last,
and the more general systems first.

8 years agologind: avoid a dot before parenthesis 1421/head
Zbigniew Jędrzejewski-Szmek [Mon, 28 Sep 2015 15:44:28 +0000 (11:44 -0400)] 
logind: avoid a dot before parenthesis

systemd-logind[27]: System is rebooting. (Applied kernel updates.)

is changed to

systemd-logind[27]: System is rebooting (Applied kernel updates).

Users should not add a dot in the sentence in --message, i.e. the correct usage is now:
$ systemctl reboot --message "Applied kernel updates"

8 years agoman: add link to kernel docs for net_cls
Zbigniew Jędrzejewski-Szmek [Wed, 30 Sep 2015 14:41:41 +0000 (10:41 -0400)] 
man: add link to kernel docs for net_cls

8 years agoman: use "=" when referring to configuration file settings
Zbigniew Jędrzejewski-Szmek [Mon, 28 Sep 2015 15:42:30 +0000 (11:42 -0400)] 
man: use "=" when referring to configuration file settings

This convention is almost universal in systemd man pages, and makes
it easier to visually parse the docs.

Also fix some markup along the way.

8 years agoman: add link to functionfs docs
Zbigniew Jędrzejewski-Szmek [Mon, 28 Sep 2015 15:40:25 +0000 (11:40 -0400)] 
man: add link to functionfs docs

Also reword some ungainly grammar constructs.

8 years agoMerge pull request #1415 from aakoskin/bootchart-v2
Daniel Mack [Wed, 30 Sep 2015 14:35:49 +0000 (16:35 +0200)] 
Merge pull request #1415 from aakoskin/bootchart-v2

[v2] bootchart: don't fail if "model name" is missing from cpuinfo

8 years agoMerge pull request #1418 from poettering/base-fs
Daniel Mack [Wed, 30 Sep 2015 14:01:42 +0000 (16:01 +0200)] 
Merge pull request #1418 from poettering/base-fs

base-fs: consider inability to create /root non-fatal

8 years agoMerge pull request #1417 from poettering/nspawn-and-more
Daniel Mack [Wed, 30 Sep 2015 13:55:26 +0000 (15:55 +0200)] 
Merge pull request #1417 from poettering/nspawn-and-more

Various fixes, primarily for nspawn, but other stuff too

8 years agobase-fs: consider inability to create /root non-fatal 1418/head
Lennart Poettering [Wed, 30 Sep 2015 13:50:42 +0000 (15:50 +0200)] 
base-fs: consider inability to create /root non-fatal

Fixes #1414

8 years agoMerge pull request #1394 from steelman/fsck-force-reboot
Lennart Poettering [Wed, 30 Sep 2015 13:39:29 +0000 (15:39 +0200)] 
Merge pull request #1394 from steelman/fsck-force-reboot

fsck: start reboot.target irreversibly

8 years agoanalyze: add new set-log-target subcommand 1417/head
Lennart Poettering [Wed, 30 Sep 2015 13:01:01 +0000 (15:01 +0200)] 
analyze: add new set-log-target subcommand

We already have the property writable, hence let's add a command to set
it.

8 years agolog: properly return -EINVAL from log_set_max_level_from_string()
Lennart Poettering [Wed, 30 Sep 2015 12:16:40 +0000 (14:16 +0200)] 
log: properly return -EINVAL from log_set_max_level_from_string()

If we just return the value we got from log_level_from_string() on
failure we'll return -1, which is not a proper error code.

log_set_target_from_string() did get this right already, hence let's fix
this here too.

8 years agonspawn: mount /sys as tmpfs, and then mount only select subdirs of the real sysfs...
Lennart Poettering [Wed, 30 Sep 2015 11:47:28 +0000 (13:47 +0200)] 
nspawn: mount /sys as tmpfs, and then mount only select subdirs of the real sysfs below it

This way we can hide things like /sys/firmware or /sys/hypervisor from
the container, while keeping the device tree around.

While this is a security benefit in itself it also allows us to fix
issue #1277.

Previously we'd mount /sys before creating the user namespace, in order
to be able to mount /sys/fs/cgroup/* beneath it (which resides in it),
which we can only mount outside of the user namespace. To ensure that
the user namespace owns the network namespace we'd set up the network
namespace at the same time as the user namespace. Thus, we'd still see
the /sys/class/net/ from the originating network namespace, even though
we are in our own network namespace now. With this patch, /sys is
mounted before transitioning into the user namespace as tmpfs, so that
we can also mount /sys/fs/cgroup/* into it this early. The directories
such as /sys/class/ are then later added in from the real sysfs from
inside the network and user namespace so that they actually show whatis
available in it.

Fixes #1277

8 years agobootchart: use get_proc_field and PROC_CPUINFO_MODEL 1415/head
Aaro Koskinen [Wed, 30 Sep 2015 12:57:55 +0000 (15:57 +0300)] 
bootchart: use get_proc_field and PROC_CPUINFO_MODEL

Use get_proc_field and PROC_CPUINFO_MODEL to get the CPU type. Also don't
fail if it missing, instead restore the old behaviour and print "Unknown".

Fixes the following error seen with v225 on powerpc:

Unable to read module name from cpuinfo.
Error generating svg file: No such file or directory

8 years agoarchitecture.h: define PROC_CPUINFO_MODEL
Aaro Koskinen [Wed, 30 Sep 2015 12:57:55 +0000 (15:57 +0300)] 
architecture.h: define PROC_CPUINFO_MODEL

Define PROC_CPUINFO_MODEL to indicate the CPU model field in /proc/cpuinfo.

8 years agofileio: make get_status_field() more generic
Aaro Koskinen [Wed, 30 Sep 2015 12:57:55 +0000 (15:57 +0300)] 
fileio: make get_status_field() more generic

All users of get_status_field() expect the field pattern to occur in
the beginning of a line, and the delimiter is ':'.

Hardcode this into the function, and also skip any whitespace before ':'
to support fields in files like /proc/cpuinfo. Add support for returning
the full field value (currently stops on first whitespace).

Rename the function so it's easier to ensure all callers switch to new
semantics.

8 years agofix typos in NEWS
Daniel Mack [Wed, 30 Sep 2015 12:03:14 +0000 (14:03 +0200)] 
fix typos in NEWS

8 years agonspawn: fix user namespace support
Lennart Poettering [Wed, 30 Sep 2015 10:48:17 +0000 (12:48 +0200)] 
nspawn: fix user namespace support

We didn#t actually pass ownership of /run to the UID in the container
since some releases, let's fix that.

8 years agoupdate NEWS
Daniel Mack [Wed, 30 Sep 2015 10:46:00 +0000 (12:46 +0200)] 
update NEWS

8 years agoupdate NEWS
Daniel Mack [Wed, 30 Sep 2015 10:40:44 +0000 (12:40 +0200)] 
update NEWS

8 years agoAdd Coccinelle patch for strempty() usage
Daniel Mack [Wed, 30 Sep 2015 10:23:57 +0000 (12:23 +0200)] 
Add Coccinelle patch for strempty() usage

8 years agonspawn: order includes
Lennart Poettering [Wed, 30 Sep 2015 10:24:06 +0000 (12:24 +0200)] 
nspawn: order includes

8 years agonspawn: make sure mount_legacy_cgroup_hierarchy() can deal with NULL root directories
Lennart Poettering [Wed, 30 Sep 2015 10:20:26 +0000 (12:20 +0200)] 
nspawn: make sure mount_legacy_cgroup_hierarchy() can deal with NULL root directories

8 years agoupdate TODO
Lennart Poettering [Wed, 30 Sep 2015 08:56:07 +0000 (10:56 +0200)] 
update TODO

8 years agosystemctl: when reading legacy -t argument for shutdown, don't drop following parameter
Lennart Poettering [Tue, 29 Sep 2015 20:40:05 +0000 (22:40 +0200)] 
systemctl: when reading legacy -t argument for shutdown, don't drop following parameter

We currently completely ignore the following parameter, but we really
should not, as that is actually the time to shut down on.

8 years agosystemctl: various modernizations
Lennart Poettering [Tue, 29 Sep 2015 20:39:49 +0000 (22:39 +0200)] 
systemctl: various modernizations

8 years agoMerge pull request #1412 from zonque/strempty
Lennart Poettering [Wed, 30 Sep 2015 10:00:46 +0000 (12:00 +0200)] 
Merge pull request #1412 from zonque/strempty

tree-wide: use strempty() where possible

8 years agotree-wide: use strempty() where possible 1412/head
Daniel Mack [Fri, 25 Sep 2015 11:36:54 +0000 (13:36 +0200)] 
tree-wide: use strempty() where possible

Also add a Coccinell patch to detect such locations in the future.

8 years agoMerge pull request #1408 from poettering/systemctl-and-more
Daniel Mack [Tue, 29 Sep 2015 20:10:40 +0000 (22:10 +0200)] 
Merge pull request #1408 from poettering/systemctl-and-more

Systemctl and more

8 years agosystemctl: when a shutdown is scheduled, always go via logind 1408/head
Lennart Poettering [Tue, 29 Sep 2015 13:09:10 +0000 (15:09 +0200)] 
systemctl: when a shutdown is scheduled, always go via logind

8 years agosystemctl: minor modernizations
Lennart Poettering [Tue, 29 Sep 2015 13:08:33 +0000 (15:08 +0200)] 
systemctl: minor modernizations

8 years agosystemctl: port verb dispatching to generic verbs.[ch] code
Lennart Poettering [Tue, 29 Sep 2015 13:00:07 +0000 (15:00 +0200)] 
systemctl: port verb dispatching to generic verbs.[ch] code

Let's parse the command line the same way in our various tools.

8 years agosystemctl: prefer shutting down through logind even as root
Lennart Poettering [Tue, 29 Sep 2015 12:00:21 +0000 (14:00 +0200)] 
systemctl: prefer shutting down through logind even as root

Otherwise, wall messages will not be generated for root.

8 years agosystemctl: split out code invoking SetExitCode() into function of its own
Lennart Poettering [Tue, 29 Sep 2015 12:00:12 +0000 (14:00 +0200)] 
systemctl: split out code invoking SetExitCode() into function of its own

8 years agopager: minor modernizations
Lennart Poettering [Tue, 29 Sep 2015 11:59:32 +0000 (13:59 +0200)] 
pager: minor modernizations

8 years agosystemctl: don't assert on the arguments array unnecessarily
Lennart Poettering [Tue, 29 Sep 2015 11:38:36 +0000 (13:38 +0200)] 
systemctl: don't assert on the arguments array unnecessarily

In most verbs it's fine to treat the arguments array being NULL is empty
array, hence do so.

8 years agosystemctl: make use of strv_skip() where appropriate
Lennart Poettering [Tue, 29 Sep 2015 11:36:07 +0000 (13:36 +0200)] 
systemctl: make use of strv_skip() where appropriate

8 years agosystemctl: make use of log_error_errno() where we can
Lennart Poettering [Tue, 29 Sep 2015 11:35:27 +0000 (13:35 +0200)] 
systemctl: make use of log_error_errno() where we can

Also adds a couple of "return" statements, where they are missing.

8 years agosystemctl: rework how we connect to busses
Lennart Poettering [Tue, 29 Sep 2015 11:13:50 +0000 (13:13 +0200)] 
systemctl: rework how we connect to busses

Sometimes we have to connect to the system manager directly (early boot,
initrd, late boot, ...), sometimes through the system bus (unprivileged,
remote, logind, ...). Instead of guessing in advance, which kind of
connection we require (and sometimes guessing incorrectly), let's make
sure each time we need  bus connection we request the right bus
explicitly.

This way, we set up exactly the bus connections require, never guess
incorrectly, and do so only immediately when necessary.

As effect this reworks avoid_bus() into install_client_side(), since
that's all it determines now: whether to install unit files client-side
or server-side (i.e. in PID 1).

8 years agocore: add a "Requires=" dependency between units and the slices they are located in
Lennart Poettering [Tue, 29 Sep 2015 11:06:28 +0000 (13:06 +0200)] 
core: add a "Requires=" dependency between units and the slices they are located in

We place the processes we fork off in the cgroup anyway, and we probably
shouldn't be able to get that far if we couldn't set up the slice due to
resource problems or unmet conditions. Hence upgrade the dependency
between units and the slices they are located in from Wants= to
Requires=.

8 years agoupdate-utmp: flush and close the bus used for connections after use
Lennart Poettering [Thu, 24 Sep 2015 11:34:08 +0000 (13:34 +0200)] 
update-utmp: flush and close the bus used for connections after use

8 years agoupdate-utmp: minor modernizations
Lennart Poettering [Thu, 24 Sep 2015 11:33:55 +0000 (13:33 +0200)] 
update-utmp: minor modernizations

8 years agobus-util: rename bus_open_transport() to bus_connect_transport()
Lennart Poettering [Thu, 24 Sep 2015 11:30:10 +0000 (13:30 +0200)] 
bus-util: rename bus_open_transport() to bus_connect_transport()

In sd-bus, the sd_bus_open_xyz() family of calls allocates a new bus,
while sd_bus_default_xyz() family tries to reuse the thread's default
bus. bus_open_transport() sometimes internally uses the former,
sometimes the latter family, but suggests it only calls the former via
its name. Hence, let's avoid this confusion, and generically rename the
call to bus_connect_transport().

Similar for all related calls.

And while we are at it, also change cgls + cgtop to do direct systemd
connections where possible, since all they do is talk to systemd itself.

8 years agopager: minor simplification
Lennart Poettering [Thu, 24 Sep 2015 10:42:30 +0000 (12:42 +0200)] 
pager: minor simplification

8 years agosystemctl: rename parse_time_spec() to parse_shutdown_time_spec()
Lennart Poettering [Thu, 24 Sep 2015 10:35:02 +0000 (12:35 +0200)] 
systemctl: rename parse_time_spec() to parse_shutdown_time_spec()

Let's clarify that this function is specific to shutdown time
specifications, nothing else.

8 years agosystemctl: conditionalize /dev/initctl fallback on HAVE_SYSV_COMPAT
Lennart Poettering [Thu, 24 Sep 2015 10:33:07 +0000 (12:33 +0200)] 
systemctl: conditionalize /dev/initctl fallback on HAVE_SYSV_COMPAT

8 years agosystemctl: allocate arg_wall only on the heap
Lennart Poettering [Thu, 24 Sep 2015 10:30:05 +0000 (12:30 +0200)] 
systemctl: allocate arg_wall only on the heap

Previously, we'd allocate it sometimes from the heap, but otherwise let
it point directly int argv[]. Let's clean this up, so that we know
exactly how to release its resources, and do so at the end.

8 years agosystemctl: add 'const' where appropriate
Lennart Poettering [Thu, 24 Sep 2015 10:28:07 +0000 (12:28 +0200)] 
systemctl: add 'const' where appropriate

8 years agosystemctl: remove client-side wall message support
Lennart Poettering [Thu, 24 Sep 2015 10:24:35 +0000 (12:24 +0200)] 
systemctl: remove client-side wall message support

logind sends out wall messages now, let's remove this from the systemctl
client side hence. If people build systemd without logind support they
won't get wall messages now, but that's OK.

8 years agosystemctl: move strv_skip_first() out of systemctl.c
Lennart Poettering [Thu, 24 Sep 2015 10:23:21 +0000 (12:23 +0200)] 
systemctl: move strv_skip_first() out of systemctl.c

Make it generic, call it strv_skip() and move it to strv.[ch]

8 years agosystemctl: split out code that schedules shutdowsn into its own function
Lennart Poettering [Thu, 24 Sep 2015 10:08:23 +0000 (12:08 +0200)] 
systemctl: split out code that schedules shutdowsn into its own function

8 years agosystemctl: rename all logind-specific functions to logind_xyz()
Lennart Poettering [Thu, 24 Sep 2015 10:07:31 +0000 (12:07 +0200)] 
systemctl: rename all logind-specific functions to logind_xyz()

8 years agosystemctl: move shutdown cancelling code into its own function
Lennart Poettering [Thu, 24 Sep 2015 09:56:04 +0000 (11:56 +0200)] 
systemctl: move shutdown cancelling code into its own function

Let's make sure the main switch statement only invokes functions, but
doesn't do anything real on its own.

8 years agosystemctl: don't special case ACTION_RUNLEVEL anymore
Lennart Poettering [Thu, 24 Sep 2015 09:54:15 +0000 (11:54 +0200)] 
systemctl: don't special case ACTION_RUNLEVEL anymore

Let's move its dispatching to the main switch statement.

8 years agosystemctl: introduce a single function to set the wall message
Lennart Poettering [Thu, 24 Sep 2015 09:51:51 +0000 (11:51 +0200)] 
systemctl: introduce a single function to set the wall message

Let's not have the same code three times, but reduce it to one function.

8 years agocore: rework crash handling
Lennart Poettering [Wed, 23 Sep 2015 21:13:06 +0000 (23:13 +0200)] 
core: rework crash handling

This introduces a new systemd.crash_reboot=1 kernel command line option
that triggers a reboot after crashing.

This also cleans up crash VT handling. Specifically, it cleans up the
configuration setting, to be between 1..63 or a boolean. This is to
replace the previous logic where "-1" meant disabled. We continue to
accept that setting, but only document the boolean syntax instead.

This also brings the documentation of the default settings in sync with
what actually happens.

The CrashChVT= configuration file setting is renamed to CrashChangeVT=,
following our usual logic of not abbreviating unnecessarily. The old
setting stays support for compat reasons.

Fixes #1300

8 years agosocket: rename ffs_xyz to usbffs_xyz
Lennart Poettering [Wed, 23 Sep 2015 18:01:54 +0000 (20:01 +0200)] 
socket: rename ffs_xyz to usbffs_xyz

The relation to USB should really be clearer.

8 years agocore: turn a large if statement into a switch
Lennart Poettering [Wed, 23 Sep 2015 17:58:59 +0000 (19:58 +0200)] 
core: turn a large if statement into a switch

8 years agoselinux: add _cleanup_ concepts to SELinux label allocation
Lennart Poettering [Wed, 23 Sep 2015 17:55:49 +0000 (19:55 +0200)] 
selinux: add _cleanup_ concepts to SELinux label allocation

8 years agocore: simplify how we create socket fds
Lennart Poettering [Wed, 23 Sep 2015 17:52:23 +0000 (19:52 +0200)] 
core: simplify how we create socket fds

Let's always return the allocated fds as return values where possible,
and make more use of _cleanup_close_

8 years agocore: small error message wording improvements
Lennart Poettering [Wed, 23 Sep 2015 17:51:45 +0000 (19:51 +0200)] 
core: small error message wording improvements

8 years agocore: properly use the ExitCode bus property when exiting is --user instance
Lennart Poettering [Wed, 23 Sep 2015 17:50:10 +0000 (19:50 +0200)] 
core: properly use the ExitCode bus property when exiting is --user instance

8 years agocore: allow setting WorkingDirectory= to the special value ~
Lennart Poettering [Wed, 23 Sep 2015 17:46:23 +0000 (19:46 +0200)] 
core: allow setting WorkingDirectory= to the special value ~

If set to ~ the working directory is set to the home directory of the
user configured in User=.

This change also exposes the existing switch for the working directory
that allowed making missing working directories non-fatal.

This also changes "machinectl shell" to make use of this to ensure that
the invoked shell is by default in the user's home directory.

Fixes #1268.

8 years agoman: also properly indent our examples to 8ch
Lennart Poettering [Wed, 23 Sep 2015 17:40:51 +0000 (19:40 +0200)] 
man: also properly indent our examples to 8ch

8 years agodetect-virt: various modernizations
Lennart Poettering [Wed, 23 Sep 2015 17:40:13 +0000 (19:40 +0200)] 
detect-virt: various modernizations

8 years agojournal-cat: various modernizations
Lennart Poettering [Wed, 23 Sep 2015 17:39:51 +0000 (19:39 +0200)] 
journal-cat: various modernizations

8 years agojournal-cat: return a correct error, not -1
Lennart Poettering [Wed, 23 Sep 2015 17:39:30 +0000 (19:39 +0200)] 
journal-cat: return a correct error, not -1

8 years agomachine-id-commit: merge machine-id-commit functionality into machine-id-setup
Lennart Poettering [Wed, 23 Sep 2015 17:36:21 +0000 (19:36 +0200)] 
machine-id-commit: merge machine-id-commit functionality into machine-id-setup

And remove machine-id-commit as separate binary.

There's really no point in keeping this separate, as the sources are
pretty much identical, and have pretty identical interfaces. Let's unify
this in one binary.

Given that machine-id-commit was a private binary of systemd (shipped in
/usr/lib/) removing the tool is not an API break.

While we are at it, improve the documentation of the command substantially.

8 years agounits: increase watchdog timeout to 3min for all our services
Lennart Poettering [Wed, 23 Sep 2015 15:27:39 +0000 (17:27 +0200)] 
units: increase watchdog timeout to 3min for all our services

Apparently, disk IO issues are more frequent than we hope, and 1min
waiting for disk IO happens, so let's increase the watchdog timeout a
bit, for all our services.

See #1353 for an example where this triggers.

8 years agosd-daemon: Simplify sd_booted() check
Lennart Poettering [Wed, 23 Sep 2015 15:23:18 +0000 (17:23 +0200)] 
sd-daemon: Simplify sd_booted() check

We can just use access() to check whether /run/system/system/ is a
directory, no need to involve stat(). The trick is to suffix the path
name with a dash.

8 years agosystemctl: make "systemctl is-system-running" return "offline" if we are not booted...
Lennart Poettering [Wed, 23 Sep 2015 15:04:43 +0000 (17:04 +0200)] 
systemctl: make "systemctl is-system-running" return "offline" if we are not booted with systemd

This sounds like the better place to expose this than in "systemd-notify
--booted".

Also document the so far undocumented "unknown" state the command might
return. And rearrange the table of states documented to be more like the
one for "is-running".

Also, don't document the precise exit code of this function, just say
errors are reported != 0 or > 0...

8 years agoMerge pull request #1398 from evverx/man-systemd-journald
Lennart Poettering [Tue, 29 Sep 2015 19:35:52 +0000 (21:35 +0200)] 
Merge pull request #1398 from evverx/man-systemd-journald

man: journald: add commands for /var/log/journal

8 years agoMerge pull request #1407 from dvdhrm/prioq
Lennart Poettering [Tue, 29 Sep 2015 19:16:14 +0000 (21:16 +0200)] 
Merge pull request #1407 from dvdhrm/prioq

prioq: drop stability guarantee

8 years agotty-ask-password: minor modernizations
Lennart Poettering [Wed, 23 Sep 2015 15:04:15 +0000 (17:04 +0200)] 
tty-ask-password: minor modernizations

8 years agoutil: introduce common version() implementation and use it everywhere
Lennart Poettering [Wed, 23 Sep 2015 01:01:06 +0000 (03:01 +0200)] 
util: introduce common version() implementation and use it everywhere

This also allows us to drop build.h from a ton of files, hence do so.
Since we touched the #includes of those files, let's order them properly
according to CODING_STYLE.

8 years agoutil: unify implementation of NOP signal handler
Lennart Poettering [Tue, 22 Sep 2015 23:32:44 +0000 (01:32 +0200)] 
util: unify implementation of NOP signal handler

This is highly complex code after all, we really should make sure to
only keep one implementation of this extremely difficult function
around.

8 years agocore: remove set_default_unit()
Lennart Poettering [Tue, 22 Sep 2015 23:14:34 +0000 (01:14 +0200)] 
core: remove set_default_unit()

The new free_and_strdup() call does pretty much the same thing these
days, no need to keep a private limited purpose version around.

8 years agocore: modernize prepare_reexecute()
Lennart Poettering [Tue, 22 Sep 2015 23:11:30 +0000 (01:11 +0200)] 
core: modernize prepare_reexecute()

8 years agocore: exit early if we hit OOM
Lennart Poettering [Tue, 22 Sep 2015 23:11:08 +0000 (01:11 +0200)] 
core: exit early if we hit OOM

8 years agocore: use %m rather than strerror() where we can
Lennart Poettering [Tue, 22 Sep 2015 23:10:47 +0000 (01:10 +0200)] 
core: use %m rather than strerror() where we can

8 years agomain: minor clean-ups
Lennart Poettering [Tue, 22 Sep 2015 23:06:56 +0000 (01:06 +0200)] 
main: minor clean-ups

Add (void) casting for a couple of functions where we knowingly ignore
the returning error code.

Use EXIT_FAILURE where appropriate.

Try to initialize structures at declaration time, or at once.

8 years agotree-wide: take benefit of the fact that fdset_free() returns NULL
Lennart Poettering [Tue, 22 Sep 2015 23:05:55 +0000 (01:05 +0200)] 
tree-wide: take benefit of the fact that fdset_free() returns NULL

8 years agocore: order #includes in main.c
Lennart Poettering [Tue, 22 Sep 2015 23:04:46 +0000 (01:04 +0200)] 
core: order #includes in main.c

8 years agostrv: add strv_free_free() to strv.c and make use of it
Lennart Poettering [Tue, 22 Sep 2015 23:01:26 +0000 (01:01 +0200)] 
strv: add strv_free_free() to strv.c and make use of it

Let's teach it a new trick, and make it return NULL.

8 years agotree-wide: port more code to use send_one_fd() and receive_one_fd()
Lennart Poettering [Tue, 22 Sep 2015 23:00:04 +0000 (01:00 +0200)] 
tree-wide: port more code to use send_one_fd() and receive_one_fd()

Also, make it slightly more powerful, by accepting a flags argument, and
make it safe for handling if more than one cmsg attribute happens to be
attached.

8 years agocore: sort includes of manager.[ch] according to CODING_STYLE
Lennart Poettering [Tue, 22 Sep 2015 21:24:07 +0000 (23:24 +0200)] 
core: sort includes of manager.[ch] according to CODING_STYLE

8 years agosd-event: don't provide priority stability 1407/head
David Herrmann [Tue, 29 Sep 2015 18:56:17 +0000 (20:56 +0200)] 
sd-event: don't provide priority stability

Currently, we guarantee that if two event-sources with the same priority
fire at the same time, they're always dispatched in the same order. While
this might sound nice in theory, there's is little benefit in providing
stability on that level. We have no control over the order the events are
reported, hence, we cannot guarantee that we get notified about both at
the same time.

By dropping the stability guarantee, we loose roughly 10% Heap swaps in
the prioq on a desktop cold-boot. Krzysztof Kotlenga even reported up to
20% on his tests. This sounds worth optimizing, so drop the stability
guarantee.

8 years agoprioq: never shuffle identical entries
David Herrmann [Tue, 29 Sep 2015 18:41:29 +0000 (20:41 +0200)] 
prioq: never shuffle identical entries

Skip shuffling identical entries in shuffle_up(), just like we already do
in shuffle_down().

8 years agoMerge pull request #1403 from dvdhrm/prioq-comment
Michal Schmidt [Tue, 29 Sep 2015 12:33:47 +0000 (14:33 +0200)] 
Merge pull request #1403 from dvdhrm/prioq-comment

prioq: add introduction comment

8 years agoprioq: add introduction comment 1403/head
David Herrmann [Tue, 29 Sep 2015 10:48:14 +0000 (12:48 +0200)] 
prioq: add introduction comment

Add comment to prioq.c explaining what it does. And more importantly,
mention that we implement a Heap. It's more than annoying having to
figure out what the code actually does, without ever mentioning the word
'heap'.

8 years agobash-completion: remove one more sort and sub-shell 1419/head
Zbigniew Jędrzejewski-Szmek [Mon, 28 Sep 2015 21:23:53 +0000 (17:23 -0400)] 
bash-completion: remove one more sort and sub-shell

{} is preferred to (), because the first is just grouping, while the
second invokes a separate shell.

8 years agobash-completion: use builtins when generating list
Zbigniew Jędrzejewski-Szmek [Mon, 28 Sep 2015 19:42:27 +0000 (15:42 -0400)] 
bash-completion: use builtins when generating list