[systemd-commits] 2 commits - man/systemd-inhibit.xml src/login

Lennart Poettering lennart at kemper.freedesktop.org
Wed Sep 19 06:29:31 PDT 2012


 man/systemd-inhibit.xml    |   24 +++++++++++++++---------
 src/login/inhibit.c        |    5 +++--
 src/login/logind-inhibit.c |    2 +-
 3 files changed, 19 insertions(+), 12 deletions(-)

New commits:
commit f981b9c5be32a199bce6335196d986f5b7e45ba6
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Sep 19 15:29:24 2012 +0200

    logind: properly parse handle-lid-switch inhibitor

diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c
index 6acc5c8..fce2f4d 100644
--- a/src/login/logind-inhibit.c
+++ b/src/login/logind-inhibit.c
@@ -442,7 +442,7 @@ InhibitWhat inhibit_what_from_string(const char *s) {
                         what |= INHIBIT_HANDLE_POWER_KEY;
                 else if (l == 16 && strncmp(w, "handle-sleep-key", l) == 0)
                         what |= INHIBIT_HANDLE_SLEEP_KEY;
-                else if (l == 16 && strncmp(w, "handle-lid-switch", l) == 0)
+                else if (l == 17 && strncmp(w, "handle-lid-switch", l) == 0)
                         what |= INHIBIT_HANDLE_LID_SWITCH;
                 else
                         return _INHIBIT_WHAT_INVALID;

commit 12a1309e117972791a84f20483e981a42be0d9ac
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Sep 19 15:28:55 2012 +0200

    man: document new inhibitor types

diff --git a/man/systemd-inhibit.xml b/man/systemd-inhibit.xml
index e19892b..f3ccee3 100644
--- a/man/systemd-inhibit.xml
+++ b/man/systemd-inhibit.xml
@@ -106,15 +106,17 @@
                                 operations to inhibit:
                                 <literal>shutdown</literal>,
                                 <literal>sleep</literal>,
-                                <literal>idle</literal>, for
-                                inhibiting
+                                <literal>idle</literal>,
+                                <literal>handle-power-key</literal>,
+                                <literal>handle-sleep-key</literal>,
+                                <literal>handle-lid-switch</literal>,
+                                for inhibiting
                                 reboot/power-off/halt/kexec,
-                                suspending/hibernating, resp. the
-                                automatic idle detection. If omitted
-                                defaults to
-                                <literal>idle:sleep:shutdown</literal>,
-                                i.e. takes all possible
-                                locks.</para></listitem>
+                                suspending/hibernating, the automatic
+                                idle detection, resp. the low-level
+                                handling of the power/sleep key and
+                                the lid switch. If omitted defaults to
+                                <literal>idle:sleep:shutdown</literal>.</para></listitem>
                         </varlistentry>
 
                         <varlistentry>
@@ -154,7 +156,11 @@
                                 time elapses the lock is ignored and
                                 the operation executed. The time limit
                                 may be specified in
-                                <citerefentry><refentrytitle>systemd-logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para></listitem>
+                                <citerefentry><refentrytitle>systemd-logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>. Note
+                                that <literal>delay</literal> is only
+                                available or <literal>sleep</literal>
+                                and
+                                <literal>shutdown</literal>.</para></listitem>
                         </varlistentry>
 
                         <varlistentry>
diff --git a/src/login/inhibit.c b/src/login/inhibit.c
index cabf1b9..28ce553 100644
--- a/src/login/inhibit.c
+++ b/src/login/inhibit.c
@@ -160,8 +160,9 @@ static int help(void) {
                "Execute a process while inhibiting shutdown/sleep/idle.\n\n"
                "  -h --help               Show this help\n"
                "     --version            Show package version\n"
-               "     --what=WHAT          Operations to inhibit, colon separated list of idle,\n"
-               "                          sleep, shutdown\n"
+               "     --what=WHAT          Operations to inhibit, colon separated list of:\n"
+               "                          shutdown, sleep, idle, handle-power-key,\n"
+               "                          handle-sleep-key, handle-lid-switch\n"
                "     --who=STRING         A descriptive string who is inhibiting\n"
                "     --why=STRING         A descriptive string why is being inhibited\n"
                "     --mode=MODE          One of block or delay\n"



More information about the systemd-commits mailing list