diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-04-16 18:41:34 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-04-16 18:41:34 -0400 |
commit | 76ec966f0e33685f8331603805c0349adceea836 (patch) | |
tree | d79f2a3c3d98e5a34e19f684d1d9ef0b61cbafd2 /src/core | |
parent | 6e1045e538a08ec68787359820a57b8b637ade70 (diff) |
tree-wide: use ERFKILL instead of ESHUTDOWN for "unit masked"
If the error code ever leaks (we print the strerror error instead of providing
our own), the message for ESHUTDOWN is "Cannot send after transport endpoint
shutdown", which can be misleading. In particular it suggest that some
mishandling of the dbus connection occured. Let's change that to ERFKILL which
has the advantage that a) it sounds implausible as actual error, b) has the
connotation of disabling something manually.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/dbus-manager.c | 2 | ||||
-rw-r--r-- | src/core/transaction.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c index 2392ed6c16..0b12aae2ef 100644 --- a/src/core/dbus-manager.c +++ b/src/core/dbus-manager.c @@ -1610,7 +1610,7 @@ fail: static int install_error(sd_bus_error *error, int c) { assert(c < 0); - if (c == -ESHUTDOWN) + if (c == -ERFKILL) return sd_bus_error_setf(error, BUS_ERROR_UNIT_MASKED, "Unit file is masked."); if (c == -EADDRNOTAVAIL) return sd_bus_error_setf(error, BUS_ERROR_UNIT_GENERATED, "Unit file is transient or generated."); diff --git a/src/core/transaction.c b/src/core/transaction.c index dad387749c..d5370b2a14 100644 --- a/src/core/transaction.c +++ b/src/core/transaction.c @@ -939,7 +939,7 @@ int transaction_add_job_and_dependencies( if (r < 0) { /* unit masked, job type not applicable and unit not found are not considered as errors. */ log_unit_full(dep, - IN_SET(r, -ESHUTDOWN, -EBADR, -ENOENT) ? LOG_DEBUG : LOG_WARNING, + IN_SET(r, -ERFKILL, -EBADR, -ENOENT) ? LOG_DEBUG : LOG_WARNING, r, "Cannot add dependency job, ignoring: %s", bus_error_message(e, r)); sd_bus_error_free(e); |