diff --git a/man/sd_id128_get_machine.xml b/man/sd_id128_get_machine.xml
index 3622bbd9f2c..827756d135d 100644
--- a/man/sd_id128_get_machine.xml
+++ b/man/sd_id128_get_machine.xml
@@ -116,9 +116,11 @@
Return Value
- The two calls return 0 on success (in which case
- ret is filled in), or a negative
- errno-style error code.
+ Those calls return 0 on success (in which case ret is filled in),
+ or a negative errno-style error code. In particular, sd_id128_get_machine()
+ and sd_id128_get_machine_app_specific() return -ENOENT
+ if /etc/machine-id is missing, and -ENOMEDIUM if is
+ empty or all zeros.
diff --git a/src/libsystemd/sd-id128/sd-id128.c b/src/libsystemd/sd-id128/sd-id128.c
index af2ff8353ab..80548fdfcf9 100644
--- a/src/libsystemd/sd-id128/sd-id128.c
+++ b/src/libsystemd/sd-id128/sd-id128.c
@@ -98,7 +98,7 @@ _public_ int sd_id128_get_machine(sd_id128_t *ret) {
return r;
if (sd_id128_is_null(saved_machine_id))
- return -EINVAL;
+ return -ENOMEDIUM;
}
*ret = saved_machine_id;