diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-05-16 13:55:12 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2018-08-24 16:47:08 +0200 |
commit | e8c63956a5a8d0c40ac2194c545edccb727cff12 (patch) | |
tree | 70bd1e95735b3d20c376bc134a9d06d19a1864c8 /src | |
parent | a1517bda5fc61271bc01ba7424b70e94a56e35a9 (diff) |
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')
-rw-r--r-- | src/libelogind/sd-id128/sd-id128.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libelogind/sd-id128/sd-id128.c b/src/libelogind/sd-id128/sd-id128.c index af2ff8353..80548fdfc 100644 --- a/src/libelogind/sd-id128/sd-id128.c +++ b/src/libelogind/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; |