From 96aad8d15a324d0e956a4e5653a11a67b209b41a Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 10 Dec 2014 19:00:46 +0100 Subject: sd-bus: move common errors src/shared/bus-errors.h → src/libsystemd/sd-bus/bus-common-errors.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stuff in src/shared/ should not use stuff from src/libsystemd/ really. --- src/core/dbus-manager.c | 2 +- src/core/dbus-scope.c | 2 +- src/core/dbus-unit.c | 2 +- src/core/dbus.c | 2 +- src/core/manager.c | 2 +- src/core/mount.c | 2 +- src/core/snapshot.c | 2 +- src/core/swap.c | 2 +- src/core/transaction.c | 2 +- src/core/unit.c | 2 +- src/fsck/fsck.c | 2 +- src/libsystemd/sd-bus/bus-common-errors.c | 76 +++++++++++++++++++++++++++++++ src/libsystemd/sd-bus/bus-common-errors.h | 74 ++++++++++++++++++++++++++++++ src/libsystemd/sd-bus/bus-error.c | 2 +- src/libsystemd/sd-bus/bus-error.h | 2 +- src/libsystemd/sd-bus/test-bus-error.c | 2 +- src/login/logind-dbus.c | 2 +- src/login/logind-seat-dbus.c | 2 +- src/login/logind-session-dbus.c | 2 +- src/machine/machine-dbus.c | 2 +- src/machine/machined-dbus.c | 2 +- src/nss-resolve/nss-resolve.c | 2 +- src/resolve-host/resolve-host.c | 2 +- src/resolve/resolved-bus.c | 2 +- src/shared/bus-errors.c | 76 ------------------------------- src/shared/bus-errors.h | 74 ------------------------------ src/systemctl/systemctl.c | 2 +- src/timedate/timedated.c | 2 +- 28 files changed, 174 insertions(+), 174 deletions(-) create mode 100644 src/libsystemd/sd-bus/bus-common-errors.c create mode 100644 src/libsystemd/sd-bus/bus-common-errors.h delete mode 100644 src/shared/bus-errors.c delete mode 100644 src/shared/bus-errors.h (limited to 'src') diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c index 140a413c17..6181ba8248 100644 --- a/src/core/dbus-manager.c +++ b/src/core/dbus-manager.c @@ -39,7 +39,7 @@ #include "dbus-unit.h" #include "dbus-snapshot.h" #include "dbus-execute.h" -#include "bus-errors.h" +#include "bus-common-errors.h" static int property_get_version( sd_bus *bus, diff --git a/src/core/dbus-scope.c b/src/core/dbus-scope.c index a762223c81..60215a1935 100644 --- a/src/core/dbus-scope.c +++ b/src/core/dbus-scope.c @@ -28,7 +28,7 @@ #include "dbus.h" #include "bus-util.h" #include "bus-internal.h" -#include "bus-errors.h" +#include "bus-common-errors.h" static int bus_scope_abandon(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { Scope *s = userdata; diff --git a/src/core/dbus-unit.c b/src/core/dbus-unit.c index cc09a268c9..0850fb3d46 100644 --- a/src/core/dbus-unit.c +++ b/src/core/dbus-unit.c @@ -26,7 +26,7 @@ #include "strv.h" #include "path-util.h" #include "fileio.h" -#include "bus-errors.h" +#include "bus-common-errors.h" #include "dbus.h" #include "dbus-manager.h" #include "dbus-unit.h" diff --git a/src/core/dbus.c b/src/core/dbus.c index 87da9335a8..260775cd85 100644 --- a/src/core/dbus.c +++ b/src/core/dbus.c @@ -39,7 +39,7 @@ #include "dbus.h" #include "bus-util.h" #include "bus-error.h" -#include "bus-errors.h" +#include "bus-common-errors.h" #include "strxcpyx.h" #include "bus-internal.h" #include "selinux-access.h" diff --git a/src/core/manager.c b/src/core/manager.c index cff24fa68e..6382400af4 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -69,7 +69,7 @@ #include "audit-fd.h" #include "boot-timestamps.h" #include "env-util.h" -#include "bus-errors.h" +#include "bus-common-errors.h" #include "bus-error.h" #include "bus-util.h" #include "dbus.h" diff --git a/src/core/mount.c b/src/core/mount.c index 6b415b44e9..e271d437cb 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -41,7 +41,7 @@ #include "unit-name.h" #include "dbus-mount.h" #include "special.h" -#include "bus-errors.h" +#include "bus-common-errors.h" #include "exit-status.h" #include "def.h" diff --git a/src/core/snapshot.c b/src/core/snapshot.c index 900d0d793a..068a077f15 100644 --- a/src/core/snapshot.c +++ b/src/core/snapshot.c @@ -25,7 +25,7 @@ #include "snapshot.h" #include "unit-name.h" #include "dbus-snapshot.h" -#include "bus-errors.h" +#include "bus-common-errors.h" static const UnitActiveState state_translation_table[_SNAPSHOT_STATE_MAX] = { [SNAPSHOT_DEAD] = UNIT_INACTIVE, diff --git a/src/core/swap.c b/src/core/swap.c index 346a5fd712..a6a23554c9 100644 --- a/src/core/swap.c +++ b/src/core/swap.c @@ -35,7 +35,7 @@ #include "unit-name.h" #include "dbus-swap.h" #include "special.h" -#include "bus-errors.h" +#include "bus-common-errors.h" #include "exit-status.h" #include "def.h" #include "path-util.h" diff --git a/src/core/transaction.c b/src/core/transaction.c index 66ee90b7b2..b0b3d6bd60 100644 --- a/src/core/transaction.c +++ b/src/core/transaction.c @@ -22,7 +22,7 @@ #include #include -#include "bus-errors.h" +#include "bus-common-errors.h" #include "bus-util.h" #include "bus-error.h" #include "transaction.h" diff --git a/src/core/unit.c b/src/core/unit.c index b3b0892f5e..fe0dfb2083 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -47,7 +47,7 @@ #include "mkdir.h" #include "label.h" #include "fileio-label.h" -#include "bus-errors.h" +#include "bus-common-errors.h" #include "dbus.h" #include "execute.h" #include "virt.h" diff --git a/src/fsck/fsck.c b/src/fsck/fsck.c index a7226ce4df..20b7940948 100644 --- a/src/fsck/fsck.c +++ b/src/fsck/fsck.c @@ -35,7 +35,7 @@ #include "special.h" #include "bus-util.h" #include "bus-error.h" -#include "bus-errors.h" +#include "bus-common-errors.h" #include "fileio.h" #include "udev-util.h" #include "path-util.h" diff --git a/src/libsystemd/sd-bus/bus-common-errors.c b/src/libsystemd/sd-bus/bus-common-errors.c new file mode 100644 index 0000000000..3dc00b5e4a --- /dev/null +++ b/src/libsystemd/sd-bus/bus-common-errors.c @@ -0,0 +1,76 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2014 Zbigniew Jędrzejewski-Szmek + + systemd is free software; you can redistribute it and/or modify it + 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include + +#include "sd-bus.h" +#include "bus-error.h" +#include "bus-common-errors.h" + +BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map bus_common_errors[] = { + SD_BUS_ERROR_MAP(BUS_ERROR_NO_SUCH_UNIT, ENOENT), + SD_BUS_ERROR_MAP(BUS_ERROR_NO_UNIT_FOR_PID, ESRCH), + SD_BUS_ERROR_MAP(BUS_ERROR_UNIT_EXISTS, EEXIST), + SD_BUS_ERROR_MAP(BUS_ERROR_LOAD_FAILED, EIO), + SD_BUS_ERROR_MAP(BUS_ERROR_JOB_FAILED, EREMOTEIO), + SD_BUS_ERROR_MAP(BUS_ERROR_NO_SUCH_JOB, ENOENT), + SD_BUS_ERROR_MAP(BUS_ERROR_NOT_SUBSCRIBED, EINVAL), + SD_BUS_ERROR_MAP(BUS_ERROR_ALREADY_SUBSCRIBED, EINVAL), + SD_BUS_ERROR_MAP(BUS_ERROR_ONLY_BY_DEPENDENCY, EINVAL), + SD_BUS_ERROR_MAP(BUS_ERROR_TRANSACTION_JOBS_CONFLICTING, EDEADLOCK), + SD_BUS_ERROR_MAP(BUS_ERROR_TRANSACTION_ORDER_IS_CYCLIC, EDEADLOCK), + SD_BUS_ERROR_MAP(BUS_ERROR_TRANSACTION_IS_DESTRUCTIVE, EDEADLOCK), + SD_BUS_ERROR_MAP(BUS_ERROR_UNIT_MASKED, ENOSYS), + SD_BUS_ERROR_MAP(BUS_ERROR_JOB_TYPE_NOT_APPLICABLE, EBADR), + SD_BUS_ERROR_MAP(BUS_ERROR_NO_ISOLATION, EPERM), + SD_BUS_ERROR_MAP(BUS_ERROR_SHUTTING_DOWN, ECANCELED), + SD_BUS_ERROR_MAP(BUS_ERROR_SCOPE_NOT_RUNNING, EHOSTDOWN), + + SD_BUS_ERROR_MAP(BUS_ERROR_NO_SUCH_MACHINE, ENXIO), + SD_BUS_ERROR_MAP(BUS_ERROR_NO_MACHINE_FOR_PID, ENXIO), + SD_BUS_ERROR_MAP(BUS_ERROR_MACHINE_EXISTS, EEXIST), + SD_BUS_ERROR_MAP(BUS_ERROR_NO_PRIVATE_NETWORKING, ENOSYS), + + SD_BUS_ERROR_MAP(BUS_ERROR_NO_SUCH_SESSION, ENXIO), + SD_BUS_ERROR_MAP(BUS_ERROR_NO_SESSION_FOR_PID, ENXIO), + SD_BUS_ERROR_MAP(BUS_ERROR_NO_SUCH_USER, ENXIO), + SD_BUS_ERROR_MAP(BUS_ERROR_NO_USER_FOR_PID, ENXIO), + SD_BUS_ERROR_MAP(BUS_ERROR_NO_SUCH_SEAT, ENXIO), + SD_BUS_ERROR_MAP(BUS_ERROR_SESSION_NOT_ON_SEAT, EINVAL), + SD_BUS_ERROR_MAP(BUS_ERROR_NOT_IN_CONTROL, EINVAL), + SD_BUS_ERROR_MAP(BUS_ERROR_DEVICE_IS_TAKEN, EINVAL), + SD_BUS_ERROR_MAP(BUS_ERROR_DEVICE_NOT_TAKEN, EINVAL), + SD_BUS_ERROR_MAP(BUS_ERROR_OPERATION_IN_PROGRESS, EINPROGRESS), + SD_BUS_ERROR_MAP(BUS_ERROR_SLEEP_VERB_NOT_SUPPORTED, ENOSYS), + + SD_BUS_ERROR_MAP(BUS_ERROR_AUTOMATIC_TIME_SYNC_ENABLED, EALREADY), + + SD_BUS_ERROR_MAP(BUS_ERROR_NO_SUCH_PROCESS, ESRCH), + + SD_BUS_ERROR_MAP(BUS_ERROR_NO_NAME_SERVERS, EIO), + SD_BUS_ERROR_MAP(BUS_ERROR_INVALID_REPLY, EINVAL), + SD_BUS_ERROR_MAP(BUS_ERROR_NO_SUCH_RR, ENOENT), + SD_BUS_ERROR_MAP(BUS_ERROR_NO_RESOURCES, ENOMEM), + SD_BUS_ERROR_MAP(BUS_ERROR_CNAME_LOOP, EDEADLOCK), + SD_BUS_ERROR_MAP(BUS_ERROR_ABORTED, ECANCELED), + + SD_BUS_ERROR_MAP_END +}; diff --git a/src/libsystemd/sd-bus/bus-common-errors.h b/src/libsystemd/sd-bus/bus-common-errors.h new file mode 100644 index 0000000000..5b7f41ef19 --- /dev/null +++ b/src/libsystemd/sd-bus/bus-common-errors.h @@ -0,0 +1,74 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +#pragma once + +/*** + This file is part of systemd. + + Copyright 2013 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ + +#include "sd-bus.h" +#include "bus-error.h" + +#define BUS_ERROR_NO_SUCH_UNIT "org.freedesktop.systemd1.NoSuchUnit" +#define BUS_ERROR_NO_UNIT_FOR_PID "org.freedesktop.systemd1.NoUnitForPID" +#define BUS_ERROR_UNIT_EXISTS "org.freedesktop.systemd1.UnitExists" +#define BUS_ERROR_LOAD_FAILED "org.freedesktop.systemd1.LoadFailed" +#define BUS_ERROR_JOB_FAILED "org.freedesktop.systemd1.JobFailed" +#define BUS_ERROR_NO_SUCH_JOB "org.freedesktop.systemd1.NoSuchJob" +#define BUS_ERROR_NOT_SUBSCRIBED "org.freedesktop.systemd1.NotSubscribed" +#define BUS_ERROR_ALREADY_SUBSCRIBED "org.freedesktop.systemd1.AlreadySubscribed" +#define BUS_ERROR_ONLY_BY_DEPENDENCY "org.freedesktop.systemd1.OnlyByDependency" +#define BUS_ERROR_TRANSACTION_JOBS_CONFLICTING "org.freedesktop.systemd1.TransactionJobsConflicting" +#define BUS_ERROR_TRANSACTION_ORDER_IS_CYCLIC "org.freedesktop.systemd1.TransactionOrderIsCyclic" +#define BUS_ERROR_TRANSACTION_IS_DESTRUCTIVE "org.freedesktop.systemd1.TransactionIsDestructive" +#define BUS_ERROR_UNIT_MASKED "org.freedesktop.systemd1.UnitMasked" +#define BUS_ERROR_JOB_TYPE_NOT_APPLICABLE "org.freedesktop.systemd1.JobTypeNotApplicable" +#define BUS_ERROR_NO_ISOLATION "org.freedesktop.systemd1.NoIsolation" +#define BUS_ERROR_SHUTTING_DOWN "org.freedesktop.systemd1.ShuttingDown" +#define BUS_ERROR_SCOPE_NOT_RUNNING "org.freedesktop.systemd1.ScopeNotRunning" + +#define BUS_ERROR_NO_SUCH_MACHINE "org.freedesktop.machine1.NoSuchMachine" +#define BUS_ERROR_NO_MACHINE_FOR_PID "org.freedesktop.machine1.NoMachineForPID" +#define BUS_ERROR_MACHINE_EXISTS "org.freedesktop.machine1.MachineExists" +#define BUS_ERROR_NO_PRIVATE_NETWORKING "org.freedesktop.machine1.NoPrivateNetworking" + +#define BUS_ERROR_NO_SUCH_SESSION "org.freedesktop.login1.NoSuchSession" +#define BUS_ERROR_NO_SESSION_FOR_PID "org.freedesktop.login1.NoSessionForPID" +#define BUS_ERROR_NO_SUCH_USER "org.freedesktop.login1.NoSuchUser" +#define BUS_ERROR_NO_USER_FOR_PID "org.freedesktop.login1.NoUserForPID" +#define BUS_ERROR_NO_SUCH_SEAT "org.freedesktop.login1.NoSuchSeat" +#define BUS_ERROR_SESSION_NOT_ON_SEAT "org.freedesktop.login1.SessionNotOnSeat" +#define BUS_ERROR_NOT_IN_CONTROL "org.freedesktop.login1.NotInControl" +#define BUS_ERROR_DEVICE_IS_TAKEN "org.freedesktop.login1.DeviceIsTaken" +#define BUS_ERROR_DEVICE_NOT_TAKEN "org.freedesktop.login1.DeviceNotTaken" +#define BUS_ERROR_OPERATION_IN_PROGRESS "org.freedesktop.login1.OperationInProgress" +#define BUS_ERROR_SLEEP_VERB_NOT_SUPPORTED "org.freedesktop.login1.SleepVerbNotSupported" + +#define BUS_ERROR_AUTOMATIC_TIME_SYNC_ENABLED "org.freedesktop.timedate1.AutomaticTimeSyncEnabled" + +#define BUS_ERROR_NO_SUCH_PROCESS "org.freedesktop.systemd1.NoSuchProcess" + +#define BUS_ERROR_NO_NAME_SERVERS "org.freedesktop.resolve1.NoNameServers" +#define BUS_ERROR_INVALID_REPLY "org.freedesktop.resolve1.InvalidReply" +#define BUS_ERROR_NO_SUCH_RR "org.freedesktop.resolve1.NoSuchRR" +#define BUS_ERROR_NO_RESOURCES "org.freedesktop.resolve1.NoResources" +#define BUS_ERROR_CNAME_LOOP "org.freedesktop.resolve1.CNameLoop" +#define BUS_ERROR_ABORTED "org.freedesktop.resolve1.Aborted" +#define _BUS_ERROR_DNS "org.freedesktop.resolve1.DnsError." + +BUS_ERROR_MAP_ELF_USE(bus_common_errors); diff --git a/src/libsystemd/sd-bus/bus-error.c b/src/libsystemd/sd-bus/bus-error.c index 157b8d890a..2955d9dd2b 100644 --- a/src/libsystemd/sd-bus/bus-error.c +++ b/src/libsystemd/sd-bus/bus-error.c @@ -32,7 +32,7 @@ #include "sd-bus.h" #include "bus-error.h" -BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map standard_errors[] = { +BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map bus_standard_errors[] = { SD_BUS_ERROR_MAP("org.freedesktop.DBus.Error.Failed", EACCES), SD_BUS_ERROR_MAP("org.freedesktop.DBus.Error.NoMemory", ENOMEM), SD_BUS_ERROR_MAP("org.freedesktop.DBus.Error.ServiceUnknown", EHOSTUNREACH), diff --git a/src/libsystemd/sd-bus/bus-error.h b/src/libsystemd/sd-bus/bus-error.h index 56297156a9..66c98b0b38 100644 --- a/src/libsystemd/sd-bus/bus-error.h +++ b/src/libsystemd/sd-bus/bus-error.h @@ -62,4 +62,4 @@ int bus_error_set_errnofv(sd_bus_error *e, int error, const char *format, va_lis * maps using the macsd-ros. */ #define BUS_ERROR_MAP_END_MARKER -'x' -BUS_ERROR_MAP_ELF_USE(standard_errors); +BUS_ERROR_MAP_ELF_USE(bus_standard_errors); diff --git a/src/libsystemd/sd-bus/test-bus-error.c b/src/libsystemd/sd-bus/test-bus-error.c index f72bcdb6b5..463fc81c75 100644 --- a/src/libsystemd/sd-bus/test-bus-error.c +++ b/src/libsystemd/sd-bus/test-bus-error.c @@ -23,7 +23,7 @@ #include "bus-error.h" #include "bus-util.h" #include "errno-list.h" -#include "bus-errors.h" +#include "bus-common-errors.h" static void test_error(void) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL, second = SD_BUS_ERROR_NULL; diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index d4123117a3..48395f6f94 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -41,7 +41,7 @@ #include "bus-util.h" #include "bus-error.h" #include "logind.h" -#include "bus-errors.h" +#include "bus-common-errors.h" #include "udev-util.h" static int property_get_idle_hint( diff --git a/src/login/logind-seat-dbus.c b/src/login/logind-seat-dbus.c index 1a2f09c615..ff87f0f741 100644 --- a/src/login/logind-seat-dbus.c +++ b/src/login/logind-seat-dbus.c @@ -26,7 +26,7 @@ #include "util.h" #include "bus-util.h" #include "strv.h" -#include "bus-errors.h" +#include "bus-common-errors.h" #include "bus-label.h" #include "logind.h" #include "logind-seat.h" diff --git a/src/login/logind-session-dbus.c b/src/login/logind-session-dbus.c index 58836fce25..8607d03265 100644 --- a/src/login/logind-session-dbus.c +++ b/src/login/logind-session-dbus.c @@ -26,7 +26,7 @@ #include "util.h" #include "strv.h" #include "bus-util.h" -#include "bus-errors.h" +#include "bus-common-errors.h" #include "bus-label.h" #include "logind.h" diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c index a2fc56f7c9..72ae6c6535 100644 --- a/src/machine/machine-dbus.c +++ b/src/machine/machine-dbus.c @@ -27,7 +27,7 @@ #include "bus-util.h" #include "bus-label.h" #include "strv.h" -#include "bus-errors.h" +#include "bus-common-errors.h" #include "copy.h" #include "fileio.h" #include "in-addr-util.h" diff --git a/src/machine/machined-dbus.c b/src/machine/machined-dbus.c index 20a98ee837..0b57b3699c 100644 --- a/src/machine/machined-dbus.c +++ b/src/machine/machined-dbus.c @@ -36,7 +36,7 @@ #include "utf8.h" #include "unit-name.h" #include "bus-util.h" -#include "bus-errors.h" +#include "bus-common-errors.h" #include "time-util.h" #include "cgroup-util.h" #include "machined.h" diff --git a/src/nss-resolve/nss-resolve.c b/src/nss-resolve/nss-resolve.c index 6a029a331b..3f32ed0650 100644 --- a/src/nss-resolve/nss-resolve.c +++ b/src/nss-resolve/nss-resolve.c @@ -33,7 +33,7 @@ #include "sd-bus.h" #include "bus-util.h" -#include "bus-errors.h" +#include "bus-common-errors.h" #include "macro.h" #include "nss-util.h" #include "util.h" diff --git a/src/resolve-host/resolve-host.c b/src/resolve-host/resolve-host.c index 4950ca1497..43ecf81ef6 100644 --- a/src/resolve-host/resolve-host.c +++ b/src/resolve-host/resolve-host.c @@ -26,7 +26,7 @@ #include "sd-bus.h" #include "bus-util.h" #include "bus-error.h" -#include "bus-errors.h" +#include "bus-common-errors.h" #include "in-addr-util.h" #include "af-list.h" #include "build.h" diff --git a/src/resolve/resolved-bus.c b/src/resolve/resolved-bus.c index ff741cdc67..8161b5321f 100644 --- a/src/resolve/resolved-bus.c +++ b/src/resolve/resolved-bus.c @@ -19,7 +19,7 @@ along with systemd; If not, see . ***/ -#include "bus-errors.h" +#include "bus-common-errors.h" #include "bus-util.h" #include "resolved-dns-domain.h" diff --git a/src/shared/bus-errors.c b/src/shared/bus-errors.c deleted file mode 100644 index c347545c71..0000000000 --- a/src/shared/bus-errors.c +++ /dev/null @@ -1,76 +0,0 @@ -/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ - -/*** - This file is part of systemd. - - Copyright 2014 Zbigniew Jędrzejewski-Szmek - - systemd is free software; you can redistribute it and/or modify it - 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include - -#include "sd-bus.h" -#include "bus-error.h" -#include "bus-errors.h" - -BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map shared_errors[] = { - SD_BUS_ERROR_MAP(BUS_ERROR_NO_SUCH_UNIT, ENOENT), - SD_BUS_ERROR_MAP(BUS_ERROR_NO_UNIT_FOR_PID, ESRCH), - SD_BUS_ERROR_MAP(BUS_ERROR_UNIT_EXISTS, EEXIST), - SD_BUS_ERROR_MAP(BUS_ERROR_LOAD_FAILED, EIO), - SD_BUS_ERROR_MAP(BUS_ERROR_JOB_FAILED, EREMOTEIO), - SD_BUS_ERROR_MAP(BUS_ERROR_NO_SUCH_JOB, ENOENT), - SD_BUS_ERROR_MAP(BUS_ERROR_NOT_SUBSCRIBED, EINVAL), - SD_BUS_ERROR_MAP(BUS_ERROR_ALREADY_SUBSCRIBED, EINVAL), - SD_BUS_ERROR_MAP(BUS_ERROR_ONLY_BY_DEPENDENCY, EINVAL), - SD_BUS_ERROR_MAP(BUS_ERROR_TRANSACTION_JOBS_CONFLICTING, EDEADLOCK), - SD_BUS_ERROR_MAP(BUS_ERROR_TRANSACTION_ORDER_IS_CYCLIC, EDEADLOCK), - SD_BUS_ERROR_MAP(BUS_ERROR_TRANSACTION_IS_DESTRUCTIVE, EDEADLOCK), - SD_BUS_ERROR_MAP(BUS_ERROR_UNIT_MASKED, ENOSYS), - SD_BUS_ERROR_MAP(BUS_ERROR_JOB_TYPE_NOT_APPLICABLE, EBADR), - SD_BUS_ERROR_MAP(BUS_ERROR_NO_ISOLATION, EPERM), - SD_BUS_ERROR_MAP(BUS_ERROR_SHUTTING_DOWN, ECANCELED), - SD_BUS_ERROR_MAP(BUS_ERROR_SCOPE_NOT_RUNNING, EHOSTDOWN), - - SD_BUS_ERROR_MAP(BUS_ERROR_NO_SUCH_MACHINE, ENXIO), - SD_BUS_ERROR_MAP(BUS_ERROR_NO_MACHINE_FOR_PID, ENXIO), - SD_BUS_ERROR_MAP(BUS_ERROR_MACHINE_EXISTS, EEXIST), - SD_BUS_ERROR_MAP(BUS_ERROR_NO_PRIVATE_NETWORKING, ENOSYS), - - SD_BUS_ERROR_MAP(BUS_ERROR_NO_SUCH_SESSION, ENXIO), - SD_BUS_ERROR_MAP(BUS_ERROR_NO_SESSION_FOR_PID, ENXIO), - SD_BUS_ERROR_MAP(BUS_ERROR_NO_SUCH_USER, ENXIO), - SD_BUS_ERROR_MAP(BUS_ERROR_NO_USER_FOR_PID, ENXIO), - SD_BUS_ERROR_MAP(BUS_ERROR_NO_SUCH_SEAT, ENXIO), - SD_BUS_ERROR_MAP(BUS_ERROR_SESSION_NOT_ON_SEAT, EINVAL), - SD_BUS_ERROR_MAP(BUS_ERROR_NOT_IN_CONTROL, EINVAL), - SD_BUS_ERROR_MAP(BUS_ERROR_DEVICE_IS_TAKEN, EINVAL), - SD_BUS_ERROR_MAP(BUS_ERROR_DEVICE_NOT_TAKEN, EINVAL), - SD_BUS_ERROR_MAP(BUS_ERROR_OPERATION_IN_PROGRESS, EINPROGRESS), - SD_BUS_ERROR_MAP(BUS_ERROR_SLEEP_VERB_NOT_SUPPORTED, ENOSYS), - - SD_BUS_ERROR_MAP(BUS_ERROR_AUTOMATIC_TIME_SYNC_ENABLED, EALREADY), - - SD_BUS_ERROR_MAP(BUS_ERROR_NO_SUCH_PROCESS, ESRCH), - - SD_BUS_ERROR_MAP(BUS_ERROR_NO_NAME_SERVERS, EIO), - SD_BUS_ERROR_MAP(BUS_ERROR_INVALID_REPLY, EINVAL), - SD_BUS_ERROR_MAP(BUS_ERROR_NO_SUCH_RR, ENOENT), - SD_BUS_ERROR_MAP(BUS_ERROR_NO_RESOURCES, ENOMEM), - SD_BUS_ERROR_MAP(BUS_ERROR_CNAME_LOOP, EDEADLOCK), - SD_BUS_ERROR_MAP(BUS_ERROR_ABORTED, ECANCELED), - - SD_BUS_ERROR_MAP_END -}; diff --git a/src/shared/bus-errors.h b/src/shared/bus-errors.h deleted file mode 100644 index e842f850c1..0000000000 --- a/src/shared/bus-errors.h +++ /dev/null @@ -1,74 +0,0 @@ -/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ - -#pragma once - -/*** - This file is part of systemd. - - Copyright 2013 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -#include "sd-bus.h" -#include "bus-error.h" - -#define BUS_ERROR_NO_SUCH_UNIT "org.freedesktop.systemd1.NoSuchUnit" -#define BUS_ERROR_NO_UNIT_FOR_PID "org.freedesktop.systemd1.NoUnitForPID" -#define BUS_ERROR_UNIT_EXISTS "org.freedesktop.systemd1.UnitExists" -#define BUS_ERROR_LOAD_FAILED "org.freedesktop.systemd1.LoadFailed" -#define BUS_ERROR_JOB_FAILED "org.freedesktop.systemd1.JobFailed" -#define BUS_ERROR_NO_SUCH_JOB "org.freedesktop.systemd1.NoSuchJob" -#define BUS_ERROR_NOT_SUBSCRIBED "org.freedesktop.systemd1.NotSubscribed" -#define BUS_ERROR_ALREADY_SUBSCRIBED "org.freedesktop.systemd1.AlreadySubscribed" -#define BUS_ERROR_ONLY_BY_DEPENDENCY "org.freedesktop.systemd1.OnlyByDependency" -#define BUS_ERROR_TRANSACTION_JOBS_CONFLICTING "org.freedesktop.systemd1.TransactionJobsConflicting" -#define BUS_ERROR_TRANSACTION_ORDER_IS_CYCLIC "org.freedesktop.systemd1.TransactionOrderIsCyclic" -#define BUS_ERROR_TRANSACTION_IS_DESTRUCTIVE "org.freedesktop.systemd1.TransactionIsDestructive" -#define BUS_ERROR_UNIT_MASKED "org.freedesktop.systemd1.UnitMasked" -#define BUS_ERROR_JOB_TYPE_NOT_APPLICABLE "org.freedesktop.systemd1.JobTypeNotApplicable" -#define BUS_ERROR_NO_ISOLATION "org.freedesktop.systemd1.NoIsolation" -#define BUS_ERROR_SHUTTING_DOWN "org.freedesktop.systemd1.ShuttingDown" -#define BUS_ERROR_SCOPE_NOT_RUNNING "org.freedesktop.systemd1.ScopeNotRunning" - -#define BUS_ERROR_NO_SUCH_MACHINE "org.freedesktop.machine1.NoSuchMachine" -#define BUS_ERROR_NO_MACHINE_FOR_PID "org.freedesktop.machine1.NoMachineForPID" -#define BUS_ERROR_MACHINE_EXISTS "org.freedesktop.machine1.MachineExists" -#define BUS_ERROR_NO_PRIVATE_NETWORKING "org.freedesktop.machine1.NoPrivateNetworking" - -#define BUS_ERROR_NO_SUCH_SESSION "org.freedesktop.login1.NoSuchSession" -#define BUS_ERROR_NO_SESSION_FOR_PID "org.freedesktop.login1.NoSessionForPID" -#define BUS_ERROR_NO_SUCH_USER "org.freedesktop.login1.NoSuchUser" -#define BUS_ERROR_NO_USER_FOR_PID "org.freedesktop.login1.NoUserForPID" -#define BUS_ERROR_NO_SUCH_SEAT "org.freedesktop.login1.NoSuchSeat" -#define BUS_ERROR_SESSION_NOT_ON_SEAT "org.freedesktop.login1.SessionNotOnSeat" -#define BUS_ERROR_NOT_IN_CONTROL "org.freedesktop.login1.NotInControl" -#define BUS_ERROR_DEVICE_IS_TAKEN "org.freedesktop.login1.DeviceIsTaken" -#define BUS_ERROR_DEVICE_NOT_TAKEN "org.freedesktop.login1.DeviceNotTaken" -#define BUS_ERROR_OPERATION_IN_PROGRESS "org.freedesktop.login1.OperationInProgress" -#define BUS_ERROR_SLEEP_VERB_NOT_SUPPORTED "org.freedesktop.login1.SleepVerbNotSupported" - -#define BUS_ERROR_AUTOMATIC_TIME_SYNC_ENABLED "org.freedesktop.timedate1.AutomaticTimeSyncEnabled" - -#define BUS_ERROR_NO_SUCH_PROCESS "org.freedesktop.systemd1.NoSuchProcess" - -#define BUS_ERROR_NO_NAME_SERVERS "org.freedesktop.resolve1.NoNameServers" -#define BUS_ERROR_INVALID_REPLY "org.freedesktop.resolve1.InvalidReply" -#define BUS_ERROR_NO_SUCH_RR "org.freedesktop.resolve1.NoSuchRR" -#define BUS_ERROR_NO_RESOURCES "org.freedesktop.resolve1.NoResources" -#define BUS_ERROR_CNAME_LOOP "org.freedesktop.resolve1.CNameLoop" -#define BUS_ERROR_ABORTED "org.freedesktop.resolve1.Aborted" -#define _BUS_ERROR_DNS "org.freedesktop.resolve1.DnsError." - -BUS_ERROR_MAP_ELF_USE(shared_errors); diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 17dfff7887..b1441ad86a 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -72,7 +72,7 @@ #include "bus-util.h" #include "bus-message.h" #include "bus-error.h" -#include "bus-errors.h" +#include "bus-common-errors.h" #include "mkdir.h" static char **arg_types = NULL; diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c index 08ddc52ca6..bf567a1624 100644 --- a/src/timedate/timedated.c +++ b/src/timedate/timedated.c @@ -39,7 +39,7 @@ #include "label.h" #include "bus-util.h" #include "bus-error.h" -#include "bus-errors.h" +#include "bus-common-errors.h" #include "event-util.h" #define NULL_ADJTIME_UTC "0.0 0 0\n0\nUTC\n" -- cgit v1.2.3-54-g00ecf