diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-09-04 09:05:52 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-03-14 10:19:06 +0100 |
commit | abbb87ffdecf445d2bba18e1638f80c96098339e (patch) | |
tree | ed6aeed11090753128077935fae61e27534b8652 /man | |
parent | 28233624dfc4ee549eaaacacf4e4f100026ba09b (diff) |
sd-login: rework error handling
Makre sure we always return sensible errors for the various, following
the same rules, and document them in a comment in sd-login.c. Also,
update all relevant man pages accordingly.
Diffstat (limited to 'man')
-rw-r--r-- | man/sd_get_seats.xml | 23 | ||||
-rw-r--r-- | man/sd_machine_get_class.xml | 31 | ||||
-rw-r--r-- | man/sd_seat_get_active.xml | 37 | ||||
-rw-r--r-- | man/sd_session_is_active.xml | 37 |
4 files changed, 127 insertions, 1 deletions
diff --git a/man/sd_get_seats.xml b/man/sd_get_seats.xml index 5a456a5f4..4c65db37c 100644 --- a/man/sd_get_seats.xml +++ b/man/sd_get_seats.xml @@ -115,6 +115,29 @@ errno-style error code.</para> </refsect1> + + <refsect1> + <title>Errors</title> + + <para>Returned errors may indicate the following problems:</para> + + <variablelist> + + <varlistentry> + <term><constant>-EINVAL</constant></term> + + <listitem><para>An input parameter was invalid (out of range, + or NULL, where that's not accepted).</para></listitem> + </varlistentry> + + <varlistentry> + <term><constant>-ENOMEM</constant></term> + + <listitem><para>Memory allocation failed.</para></listitem> + </varlistentry> + </variablelist> + </refsect1> + <refsect1> <title>Notes</title> diff --git a/man/sd_machine_get_class.xml b/man/sd_machine_get_class.xml index 1de911657..a874249af 100644 --- a/man/sd_machine_get_class.xml +++ b/man/sd_machine_get_class.xml @@ -56,7 +56,7 @@ <funcprototype> <funcdef>int <function>sd_machine_get_class</function></funcdef> <paramdef>const char* <parameter>machine</parameter></paramdef> - <paramdef>char *<parameter>class</parameter></paramdef> + <paramdef>char **<parameter>class</parameter></paramdef> </funcprototype> <funcprototype> @@ -99,6 +99,35 @@ </refsect1> <refsect1> + <title>Errors</title> + + <para>Returned errors may indicate the following problems:</para> + + <variablelist> + + <varlistentry> + <term><constant>-ENXIO</constant></term> + + <listitem><para>The specified machine does not exist or is currently not running.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term><constant>-EINVAL</constant></term> + + <listitem><para>An input parameter was invalid (out of range, + or NULL, where that's not accepted).</para></listitem> + </varlistentry> + + <varlistentry> + <term><constant>-ENOMEM</constant></term> + + <listitem><para>Memory allocation failed.</para></listitem> + </varlistentry> + </variablelist> + </refsect1> + + <refsect1> <title>Notes</title> <para>The <function>sd_machine_get_class()</function> and diff --git a/man/sd_seat_get_active.xml b/man/sd_seat_get_active.xml index 793bbc8c9..6dda53512 100644 --- a/man/sd_seat_get_active.xml +++ b/man/sd_seat_get_active.xml @@ -149,6 +149,43 @@ </refsect1> <refsect1> + <title>Errors</title> + + <para>Returned errors may indicate the following problems:</para> + + <variablelist> + + <varlistentry> + <term><constant>-ENODATA</constant></term> + + <listitem><para>Given field is not specified for the described + seat.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term><constant>-ENXIO</constant></term> + + <listitem><para>The specified seat is unknown.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term><constant>-EINVAL</constant></term> + + <listitem><para>An input parameter was invalid (out of range, + or NULL, where that's not accepted).</para></listitem> + </varlistentry> + + <varlistentry> + <term><constant>-ENOMEM</constant></term> + + <listitem><para>Memory allocation failed.</para></listitem> + </varlistentry> + </variablelist> + </refsect1> + + <refsect1> <title>Notes</title> <para>The <function>sd_seat_get_active()</function>, diff --git a/man/sd_session_is_active.xml b/man/sd_session_is_active.xml index 55726f96a..c522a8eda 100644 --- a/man/sd_session_is_active.xml +++ b/man/sd_session_is_active.xml @@ -290,6 +290,43 @@ </refsect1> <refsect1> + <title>Errors</title> + + <para>Returned errors may indicate the following problems:</para> + + <variablelist> + + <varlistentry> + <term><constant>-ENXIO</constant></term> + + <listitem><para>The specified session does not exist.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term><constant>-ENODATA</constant></term> + + <listitem><para>Given field is not specified for the described + session.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term><constant>-EINVAL</constant></term> + + <listitem><para>An input parameter was invalid (out of range, + or NULL, where that's not accepted).</para></listitem> + </varlistentry> + + <varlistentry> + <term><constant>-ENOMEM</constant></term> + + <listitem><para>Memory allocation failed.</para></listitem> + </varlistentry> + </variablelist> + </refsect1> + + <refsect1> <title>Notes</title> <para>The <function>sd_session_is_active()</function>, |