Copyright 2010 Lennart Poettering
systemd is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
+ Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "unit-name.h"
#include "dbus-device.h"
#include "def.h"
+#include "path-util.h"
static const UnitActiveState state_translation_table[_DEVICE_STATE_MAX] = {
[DEVICE_DEAD] = UNIT_INACTIVE,
assert(dn);
assert(dn[0] == '/');
- if (!(e = unit_name_from_path(dn, ".device")))
+ e = unit_name_from_path(dn, ".device");
+ if (!e)
return -ENOMEM;
r = unit_add_name(u, e);
assert(dn[0] == '/');
assert(_u);
- if (!(e = unit_name_from_path(dn, ".device")))
+ e = unit_name_from_path(dn, ".device");
+ if (!e)
return -ENOMEM;
u = manager_get_unit(m, e);
DEFINE_STRING_TABLE_LOOKUP(device_state, DeviceState);
const UnitVTable device_vtable = {
- .suffix = ".device",
.object_size = sizeof(Device),
.sections =
"Unit\0"
.following_set = device_following_set,
.enumerate = device_enumerate,
- .shutdown = device_shutdown
+ .shutdown = device_shutdown,
+
+ .status_message_formats = {
+ .starting_stopping = {
+ [0] = "Expecting device %s...",
+ },
+ .finished_start_job = {
+ [JOB_DONE] = "Found device %s.",
+ [JOB_TIMEOUT] = "Timed out waiting for device %s.",
+ },
+ },
};