Commit graph

5 commits

Author SHA1 Message Date
Thomas Bächler 9ac441c0f4 sd-event: Fix systemd crash when using timer units.
There was a copy-paste error introduced in commit c2ba3ad660
which causes the following error when using timer units:

Assertion '(x->type == SOURCE_MONOTONIC && y->type == SOURCE_MONOTONIC) || (x->type == SOURCE_REALTIME && y->type == SOURCE_REALTIME)'
failed at src/libsystemd/sd-event/sd-event.c:264, function latest_time_prioq_compare(). Aborting.
2014-02-21 14:06:50 +01:00
Lennart Poettering 151b9b9662 api: in constructor function calls, always put the returned object pointer first (or second)
Previously the returned object of constructor functions where sometimes
returned as last, sometimes as first and sometimes as second parameter.
Let's clean this up a bit. Here are the new rules:

1. The object the new object is derived from is put first, if there is any

2. The object we are creating will be returned in the next arguments

3. This is followed by any additional arguments

Rationale:

For functions that operate on an object we always put that object first.
Constructors should probably not be too different in this regard. Also,
if the additional parameters might want to use varargs which suggests to
put them last.

Note that this new scheme only applies to constructor functions, not to
all other functions. We do give a lot of freedom for those.

Note that this commit only changes the order of the new functions we
added, for old ones we accept the wrong order and leave it like that.
2014-02-20 00:03:10 +01:00
Lennart Poettering 39883f622f make gcc shut up
If -flto is used then gcc will generate a lot more warnings than before,
among them a number of use-without-initialization warnings. Most of them
without are false positives, but let's make them go away, because it
doesn't really matter.
2014-02-19 17:53:50 +01:00
David Herrmann 7a0d4a3d16 event: fix crash on child-source state modifications
Setting a child-source state to anything but SD_EVENT_OFF currently does
nothing. The condition logic is flawed. Move the state update *below* the
test for the previous state.

Fixes a crash if you call:
  sd_event_source_set_enabled(source, SD_EVENT_ON);
  sd_event_source_unref(source);
on a child-source in its own callback.
2014-02-19 13:24:38 +01:00
Tom Gundersen 607553f930 libsystemd: split up into subdirs
We still only produce on .so, but let's keep the sources separate to make things a bit
less messy.
2014-01-21 14:41:35 +01:00
Renamed from src/libsystemd/sd-event.c (Browse further)