]>
Commit | Line | Data |
---|---|---|
03467c88 | 1 | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ |
4c90c122 LP |
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 | |
5430f7f2 LP |
12 | under the terms of the GNU Lesser General Public License as published by |
13 | the Free Software Foundation; either version 2.1 of the License, or | |
4c90c122 LP |
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 | |
5430f7f2 | 19 | Lesser General Public License for more details. |
4c90c122 | 20 | |
5430f7f2 | 21 | You should have received a copy of the GNU Lesser General Public License |
4c90c122 LP |
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" | |
2528a7a6 | 38 | #define BUS_ERROR_NO_ISOLATION "org.freedesktop.systemd1.NoIsolation" |
4c90c122 | 39 | #define BUS_ERROR_LOAD_FAILED "org.freedesktop.systemd1.LoadFailed" |
6daf4f90 | 40 | #define BUS_ERROR_MASKED "org.freedesktop.systemd1.Masked" |
4c90c122 LP |
41 | #define BUS_ERROR_JOB_TYPE_NOT_APPLICABLE "org.freedesktop.systemd1.JobTypeNotApplicable" |
42 | #define BUS_ERROR_TRANSACTION_IS_DESTRUCTIVE "org.freedesktop.systemd1.TransactionIsDestructive" | |
43 | #define BUS_ERROR_TRANSACTION_JOBS_CONFLICTING "org.freedesktop.systemd1.TransactionJobsConflicting" | |
44 | #define BUS_ERROR_TRANSACTION_ORDER_IS_CYCLIC "org.freedesktop.systemd1.TransactionOrderIsCyclic" | |
8f6df3fa | 45 | #define BUS_ERROR_SHUTTING_DOWN "org.freedesktop.systemd1.ShuttingDown" |
8a0867d6 | 46 | #define BUS_ERROR_NO_SUCH_PROCESS "org.freedesktop.systemd1.NoSuchProcess" |
4c90c122 LP |
47 | |
48 | static inline const char *bus_error(const DBusError *e, int r) { | |
49 | if (e && e->message) | |
50 | return e->message; | |
51 | ||
52 | if (r >= 0) | |
53 | return strerror(r); | |
54 | ||
55 | return strerror(-r); | |
56 | } | |
57 | ||
58 | #endif |