diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-05-16 13:55:12 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-05-31 13:04:18 +0200 |
commit | ea03f6ba0d66374594d716fc0e84e4d65906d2c3 (patch) | |
tree | f427ed1d3912498055de1e6616f6b9b9d84f0945 /man/sd_id128_get_machine.xml | |
parent | 63e2ebcdaa424e7ddf107312ed02edb176e2bb9f (diff) | |
download | systemd-ea03f6ba0d66374594d716fc0e84e4d65906d2c3.tar.gz |
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 'man/sd_id128_get_machine.xml')
-rw-r--r-- | man/sd_id128_get_machine.xml | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/man/sd_id128_get_machine.xml b/man/sd_id128_get_machine.xml index 3622bbd9f2..827756d135 100644 --- a/man/sd_id128_get_machine.xml +++ b/man/sd_id128_get_machine.xml @@ -116,9 +116,11 @@ <refsect1> <title>Return Value</title> - <para>The two calls return 0 on success (in which case - <parameter>ret</parameter> is filled in), or a negative - errno-style error code.</para> + <para>Those calls return 0 on success (in which case <parameter>ret</parameter> is filled in), + or a negative errno-style error code. In particular, <function>sd_id128_get_machine()</function> + and <function>sd_id128_get_machine_app_specific()</function> return <constant>-ENOENT</constant> + if <filename>/etc/machine-id</filename> is missing, and <constant>-ENOMEDIUM</constant> if is + empty or all zeros.</para> </refsect1> <refsect1> |