chiark / gitweb /
core: change internal error code for masked units from EBADR to ESHUTDOWN
authorLennart Poettering <lennart@poettering.net>
Tue, 9 Feb 2016 19:28:58 +0000 (20:28 +0100)
committerSven Eden <yamakuzure@gmx.net>
Wed, 17 May 2017 13:22:16 +0000 (15:22 +0200)
commit9dfb8abdc29595eddf95a27811194234c81cd351
tree322f24b48d9e80a89b24314d7fe29330744d5520
parentc549c705f8856bec29760614bd507e53c2e2a97f
core: change internal error code for masked units from EBADR to ESHUTDOWN

This commit changes the mapping of the BUS_ERROR_UNIT_MASKED error to ESHUTDOWN. This error is used whenever the
transaction engine is asked to operate on a masked unit. ESHUTDOWN is what is used for the similar case when the unit
file enable/disable logic hits a masked unit file, hence is a natural candidate to be used here too.

Background: before this patch both "job type not applicable" and "unit masked" where mapped to EBADR, which
transaction_add_job_and_dependencies() then checked for. It actually wanted to check exclusively for the former error
condition, not the latter but due to the same mapping this failed to work.

This patch semi-undoes an accidental change made in caffa4ef700fdd0eadd6c0b2ef9925611672a1bc, however restores the
error number to ESHUTDOWN instead of the original ENOSYS (for the reasons indicated above).

To make this easier to grok for the future, I added comments to explaining which error conditions are checked for.

Fixes: #2315
src/libelogind/sd-bus/bus-common-errors.c