diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-05-05 00:46:31 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-05-08 13:54:23 +0200 |
commit | 4943c1c94ba751c98763f4232b4350481b22c90a (patch) | |
tree | b43c4026d0941298ddff971f191ca40b1e2c56b5 /src | |
parent | dd5f0a96f734aafa00f6c3aea4003b7fdd278d81 (diff) |
logind: use "sleep" as generic term for "suspend", "hibernate", and later on "hybrid suspend"
Diffstat (limited to 'src')
-rw-r--r-- | src/login/inhibit.c | 6 | ||||
-rw-r--r-- | src/login/logind-inhibit.c | 12 | ||||
-rw-r--r-- | src/login/logind-inhibit.h | 2 | ||||
-rw-r--r-- | src/login/test-inhibit.c | 2 |
4 files changed, 11 insertions, 11 deletions
diff --git a/src/login/inhibit.c b/src/login/inhibit.c index a817c84b36..6f24a1b671 100644 --- a/src/login/inhibit.c +++ b/src/login/inhibit.c @@ -31,7 +31,7 @@ #include "build.h" #include "strv.h" -static const char* arg_what = "idle:suspend:shutdown"; +static const char* arg_what = "idle:sleep:shutdown"; static const char* arg_who = NULL; static const char* arg_why = "Unknown reason"; static const char* arg_mode = "block"; @@ -182,11 +182,11 @@ finish: static int help(void) { printf("%s [OPTIONS...] {COMMAND} ...\n\n" - "Execute a process while inhibiting shutdown/suspend/idle.\n\n" + "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" - " suspend, shutdown\n" + " sleep, shutdown\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" diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c index b5b801e5e0..2007ec79e4 100644 --- a/src/login/logind-inhibit.c +++ b/src/login/logind-inhibit.c @@ -376,12 +376,12 @@ const char *inhibit_what_to_string(InhibitWhat w) { static const char* const table[_INHIBIT_WHAT_MAX] = { [0] = "", [INHIBIT_SHUTDOWN] = "shutdown", - [INHIBIT_SUSPEND] = "suspend", + [INHIBIT_SLEEP] = "sleep", [INHIBIT_IDLE] = "idle", - [INHIBIT_SHUTDOWN|INHIBIT_SUSPEND] = "shutdown:suspend", + [INHIBIT_SHUTDOWN|INHIBIT_SLEEP] = "shutdown:sleep", [INHIBIT_SHUTDOWN|INHIBIT_IDLE] = "shutdown:idle", - [INHIBIT_SHUTDOWN|INHIBIT_SUSPEND|INHIBIT_IDLE] = "shutdown:suspend:idle", - [INHIBIT_SUSPEND|INHIBIT_IDLE] = "suspend:idle" + [INHIBIT_SHUTDOWN|INHIBIT_SLEEP|INHIBIT_IDLE] = "shutdown:sleep:idle", + [INHIBIT_SLEEP|INHIBIT_IDLE] = "sleep:idle" }; if (w < 0 || w >= _INHIBIT_WHAT_MAX) @@ -398,8 +398,8 @@ InhibitWhat inhibit_what_from_string(const char *s) { FOREACH_WORD_SEPARATOR(w, l, s, ":", state) { if (l == 8 && strncmp(w, "shutdown", l) == 0) what |= INHIBIT_SHUTDOWN; - else if (l == 7 && strncmp(w, "suspend", l) == 0) - what |= INHIBIT_SUSPEND; + else if (l == 5 && strncmp(w, "sleep", l) == 0) + what |= INHIBIT_SLEEP; else if (l == 4 && strncmp(w, "idle", l) == 0) what |= INHIBIT_IDLE; else diff --git a/src/login/logind-inhibit.h b/src/login/logind-inhibit.h index 823af39918..6364b00586 100644 --- a/src/login/logind-inhibit.h +++ b/src/login/logind-inhibit.h @@ -31,7 +31,7 @@ typedef struct Inhibitor Inhibitor; typedef enum InhibitWhat { INHIBIT_SHUTDOWN = 1, - INHIBIT_SUSPEND = 2, + INHIBIT_SLEEP = 2, INHIBIT_IDLE = 4, _INHIBIT_WHAT_MAX = 8, _INHIBIT_WHAT_INVALID = -1 diff --git a/src/login/test-inhibit.c b/src/login/test-inhibit.c index 634f1e1284..7b6deffc3e 100644 --- a/src/login/test-inhibit.c +++ b/src/login/test-inhibit.c @@ -119,7 +119,7 @@ int main(int argc, char*argv[]) { print_inhibitors(bus); - fd1 = inhibit(bus, "suspend"); + fd1 = inhibit(bus, "sleep"); assert(fd1 >= 0); print_inhibitors(bus); |