~ubuntu-branches/debian/jessie/systemd/jessie

« back to all changes in this revision

Viewing changes to src/dbus-timer.c

  • Committer: Package Import Robot
  • Author(s): Tollef Fog Heen, Tollef Fog Heen, Michael Biebl
  • Date: 2012-04-03 19:59:17 UTC
  • mfrom: (1.1.10) (6.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20120403195917-l532urrbg4pkreas
Tags: 44-1
[ Tollef Fog Heen ]
* New upstream version.
  - Backport 3492207: journal: PAGE_SIZE is not known on ppc and other
    archs
  - Backport 5a2a2a1: journal: react with immediate rotation to a couple
    of more errors
  - Backport 693ce21: util: never follow symlinks in rm_rf_children()
    Fixes CVE-2012-1174, closes: #664364
* Drop output message from init-functions hook, it's pointless.
* Only rmdir /lib/init/rw if it exists.
* Explicitly order debian-fixup before sysinit.target to prevent a
  possible race condition with the creation of sockets.  Thanks to
  Michael Biebl for debugging this.
* Always restart the initctl socket on upgrades, to mask sysvinit
  removing it.

[ Michael Biebl ]
* Remove workaround for non-interactive sessions from pam config again.
* Create compat /dev/initctl symlink in case we are upgrading from a system
  running a newer version of sysvinit (using /run/initctl) and sysvinit is
  replaced with systemd-sysv during the upgrade. Closes: #663219
* Install new man pages.
* Build-Depend on valac (>= 0.12) instead of valac-0.12. Closes: #663323

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
        "  <property name=\"Unit\" type=\"s\" access=\"read\"/>\n"      \
32
32
        "  <property name=\"Timers\" type=\"a(stt)\" access=\"read\"/>\n" \
33
33
        "  <property name=\"NextElapseUSec\" type=\"t\" access=\"read\"/>\n" \
 
34
        "  <property name=\"Result\" type=\"s\" access=\"read\"/>\n"    \
34
35
        " </interface>\n"
35
36
 
36
37
#define INTROSPECTION                                                   \
51
52
 
52
53
const char bus_timer_invalidating_properties[] =
53
54
        "Timers\0"
54
 
        "NextElapseUSec\0";
 
55
        "NextElapseUSec\0"
 
56
        "Result\0";
55
57
 
56
58
static int bus_timer_append_timers(DBusMessageIter *i, const char *property, void *data) {
57
59
        Timer *p = data;
101
103
 
102
104
static int bus_timer_append_unit(DBusMessageIter *i, const char *property, void *data) {
103
105
        Unit *u = data;
 
106
        Timer *timer = TIMER(u);
104
107
        const char *t;
105
108
 
106
109
        assert(i);
107
110
        assert(property);
108
111
        assert(u);
109
112
 
110
 
        t = u->timer.unit ? u->timer.unit->meta.id : "";
 
113
        t = UNIT_DEREF(timer->unit) ? UNIT_DEREF(timer->unit)->id : "";
111
114
 
112
115
        return dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &t) ? 0 : -ENOMEM;
113
116
}
114
117
 
 
118
static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_timer_append_timer_result, timer_result, TimerResult);
 
119
 
 
120
static const BusProperty bus_timer_properties[] = {
 
121
        { "Unit",           bus_timer_append_unit,        "s", 0 },
 
122
        { "Timers",         bus_timer_append_timers, "a(stt)", 0 },
 
123
        { "NextElapseUSec", bus_property_append_usec,     "t", offsetof(Timer, next_elapse) },
 
124
        { "Result",         bus_timer_append_timer_result,"s", offsetof(Timer, result)      },
 
125
        { NULL, }
 
126
};
 
127
 
115
128
DBusHandlerResult bus_timer_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
116
 
        const BusProperty properties[] = {
117
 
                BUS_UNIT_PROPERTIES,
118
 
                { "org.freedesktop.systemd1.Timer", "Unit",           bus_timer_append_unit,      "s",      u                      },
119
 
                { "org.freedesktop.systemd1.Timer", "Timers",         bus_timer_append_timers,    "a(stt)", u                      },
120
 
                { "org.freedesktop.systemd1.Timer", "NextElapseUSec", bus_property_append_usec,   "t",      &u->timer.next_elapse  },
121
 
                { NULL, NULL, NULL, NULL, NULL }
 
129
        Timer *t = TIMER(u);
 
130
        const BusBoundProperties bps[] = {
 
131
                { "org.freedesktop.systemd1.Unit",  bus_unit_properties,  u },
 
132
                { "org.freedesktop.systemd1.Timer", bus_timer_properties, t },
 
133
                { NULL, }
122
134
        };
123
135
 
124
 
        return bus_default_message_handler(c, message, INTROSPECTION, INTERFACES_LIST, properties);
 
136
        return bus_default_message_handler(c, message, INTROSPECTION, INTERFACES_LIST, bps);
125
137
}