aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-05-16 13:55:12 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-05-31 13:04:18 +0200
commitea03f6ba0d66374594d716fc0e84e4d65906d2c3 (patch)
treef427ed1d3912498055de1e6616f6b9b9d84f0945 /src/libsystemd
parentfuzz-journal-remote: allow fuzzer to be built without µhttpd (diff)
downloadsystemd-ea03f6ba0d66374594d716fc0e84e4d65906d2c3.tar.gz
systemd-ea03f6ba0d66374594d716fc0e84e4d65906d2c3.tar.bz2
systemd-ea03f6ba0d66374594d716fc0e84e4d65906d2c3.zip
sd-id128: return -ENOMEDIUM on null id
We currently return -ENOMEDIUM when /etc/machine-id is empty, and -EINVAL when it is all zeros. But -EINVAL is also used for invalid args. The distinction between empty and all-zero is not very important, let's use the same return code. Also document -ENOENT and -ENOMEDIUM since they can be a bit surprising.
Diffstat (limited to 'src/libsystemd')
-rw-r--r--src/libsystemd/sd-id128/sd-id128.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd/sd-id128/sd-id128.c b/src/libsystemd/sd-id128/sd-id128.c
index af2ff8353..80548fdfc 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;