chiark / gitweb /
cgroup: treat non-existing cgroups like empty ones, to deal with races
[elogind.git] / src / bus-errors.h
1 /*-*- Mode: C; c-basic-offset: 8 -*-*/
2
3 #ifndef foobuserrorshfoo
4 #define foobuserrorshfoo
5
6 /***
7   This file is part of systemd.
8
9   Copyright 2010 Lennart Poettering
10
11   systemd is free software; you can redistribute it and/or modify it
12   under the terms of the GNU General Public License as published by
13   the Free Software Foundation; either version 2 of the License, or
14   (at your option) any later version.
15
16   systemd is distributed in the hope that it will be useful, but
17   WITHOUT ANY WARRANTY; without even the implied warranty of
18   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19   General Public License for more details.
20
21   You should have received a copy of the GNU General Public License
22   along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 ***/
24
25 #include <string.h>
26 #include <dbus/dbus.h>
27
28 #define BUS_ERROR_NO_SUCH_UNIT "org.freedesktop.systemd1.NoSuchUnit"
29 #define BUS_ERROR_NO_SUCH_JOB "org.freedesktop.systemd1.NoSuchJob"
30 #define BUS_ERROR_NOT_SUBSCRIBED "org.freedesktop.systemd1.NotSubscribed"
31 #define BUS_ERROR_INVALID_PATH "org.freedesktop.systemd1.InvalidPath"
32 #define BUS_ERROR_INVALID_NAME "org.freedesktop.systemd1.InvalidName"
33 #define BUS_ERROR_UNIT_TYPE_MISMATCH "org.freedesktop.systemd1.UnitTypeMismatch"
34 #define BUS_ERROR_UNIT_EXISTS "org.freedesktop.systemd1.UnitExists"
35 #define BUS_ERROR_NOT_SUPPORTED "org.freedesktop.systemd1.NotSupported"
36 #define BUS_ERROR_INVALID_JOB_MODE "org.freedesktop.systemd1.InvalidJobMode"
37 #define BUS_ERROR_ONLY_BY_DEPENDENCY "org.freedesktop.systemd1.OnlyByDependency"
38 #define BUS_ERROR_LOAD_FAILED "org.freedesktop.systemd1.LoadFailed"
39 #define BUS_ERROR_JOB_TYPE_NOT_APPLICABLE "org.freedesktop.systemd1.JobTypeNotApplicable"
40 #define BUS_ERROR_TRANSACTION_IS_DESTRUCTIVE "org.freedesktop.systemd1.TransactionIsDestructive"
41 #define BUS_ERROR_TRANSACTION_JOBS_CONFLICTING "org.freedesktop.systemd1.TransactionJobsConflicting"
42 #define BUS_ERROR_TRANSACTION_ORDER_IS_CYCLIC "org.freedesktop.systemd1.TransactionOrderIsCyclic"
43
44 static inline const char *bus_error(const DBusError *e, int r) {
45         if (e && e->message)
46                 return e->message;
47
48         if (r >= 0)
49                 return strerror(r);
50
51         return strerror(-r);
52 }
53
54 #endif