sysupdated: Register known error types
This fixes a bug introduced during review of sysupdated. Originally, we just returned EALREADY verbatim to signify that the target is already up-to-date. Then we switched this to a proper error (org.freedesktop.sysupdate1.NoCandidate) during review. But that now maps to EIO, not EALREADY. Thus, whenever there's nothing to update, updatectl would report I/O errors to the user, even though nothing actually went wrong.
This commit is contained in:
@@ -153,5 +153,7 @@ BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map bus_common_errors[] = {
|
||||
SD_BUS_ERROR_MAP(BUS_ERROR_REBALANCE_NOT_NEEDED, EALREADY),
|
||||
SD_BUS_ERROR_MAP(BUS_ERROR_HOME_NOT_REFERENCED, EBADR),
|
||||
|
||||
SD_BUS_ERROR_MAP(BUS_ERROR_NO_UPDATE_CANDIDATE, EALREADY),
|
||||
|
||||
SD_BUS_ERROR_MAP_END
|
||||
};
|
||||
|
||||
@@ -158,4 +158,6 @@
|
||||
#define BUS_ERROR_REBALANCE_NOT_NEEDED "org.freedesktop.home1.RebalanceNotNeeded"
|
||||
#define BUS_ERROR_HOME_NOT_REFERENCED "org.freedesktop.home1.HomeNotReferenced"
|
||||
|
||||
#define BUS_ERROR_NO_UPDATE_CANDIDATE "org.freedesktop.sysupdate1.NoCandidate"
|
||||
|
||||
BUS_ERROR_MAP_ELF_USE(bus_common_errors);
|
||||
|
||||
Reference in New Issue
Block a user