diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-09-21 15:44:14 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-09-21 15:44:14 +0200 |
commit | 8e7fd6ade44ce5dde0867ba748c7978ed1206865 (patch) | |
tree | ced70d8e4c3d4e14f70ac459277c9046bd26500c /src/login/logind-inhibit.c | |
parent | 636d30a0895f17eca8313d50f9b2fc1ec5e128da (diff) |
logind: split up HandleSleepKey= into HandleSuspendKey= and HandleHibernateKey=
The kernel and X11 distuingish these two, and Thinkpad keys have both,
hence we really should distinguish them too.
Diffstat (limited to 'src/login/logind-inhibit.c')
-rw-r--r-- | src/login/logind-inhibit.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c index 66e4c29f36..f1b9cca834 100644 --- a/src/login/logind-inhibit.c +++ b/src/login/logind-inhibit.c @@ -403,7 +403,7 @@ bool manager_is_inhibited( } const char *inhibit_what_to_string(InhibitWhat w) { - static __thread char buffer[73]; + static __thread char buffer[97]; char *p; if (w < 0 || w >= _INHIBIT_WHAT_MAX) @@ -418,8 +418,10 @@ const char *inhibit_what_to_string(InhibitWhat w) { p = stpcpy(p, "idle:"); if (w & INHIBIT_HANDLE_POWER_KEY) p = stpcpy(p, "handle-power-key:"); - if (w & INHIBIT_HANDLE_SLEEP_KEY) - p = stpcpy(p, "handle-sleep-key:"); + if (w & INHIBIT_HANDLE_SUSPEND_KEY) + p = stpcpy(p, "handle-suspend-key:"); + if (w & INHIBIT_HANDLE_HIBERNATE_KEY) + p = stpcpy(p, "handle-hibernate-key:"); if (w & INHIBIT_HANDLE_LID_SWITCH) p = stpcpy(p, "handle-lid-switch:"); @@ -445,8 +447,10 @@ InhibitWhat inhibit_what_from_string(const char *s) { what |= INHIBIT_IDLE; else if (l == 16 && strncmp(w, "handle-power-key", l) == 0) what |= INHIBIT_HANDLE_POWER_KEY; - else if (l == 16 && strncmp(w, "handle-sleep-key", l) == 0) - what |= INHIBIT_HANDLE_SLEEP_KEY; + else if (l == 18 && strncmp(w, "handle-suspend-key", l) == 0) + what |= INHIBIT_HANDLE_SUSPEND_KEY; + else if (l == 20 && strncmp(w, "handle-hibernate-key", l) == 0) + what |= INHIBIT_HANDLE_HIBERNATE_KEY; else if (l == 17 && strncmp(w, "handle-lid-switch", l) == 0) what |= INHIBIT_HANDLE_LID_SWITCH; else |