X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flogin%2Flogind-inhibit.c;h=512fc0716bb4f1ad9ad3b6833ec7907f8a016331;hb=36140842612803d71fe771ce03f3dee7732284f0;hp=b5b801e5e09a84bcbaa8d9cb43391c66e0304366;hpb=9eb977db5b89b44f254ab40c1876a76b7d7ea2d0;p=elogind.git diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c index b5b801e5e..512fc0716 100644 --- a/src/login/logind-inhibit.c +++ b/src/login/logind-inhibit.c @@ -163,7 +163,7 @@ int inhibitor_start(Inhibitor *i) { i->started = true; - manager_send_changed(i->manager, "Inhibited\0"); + manager_send_changed(i->manager, i->mode == INHIBIT_BLOCK ? "BlockInhibited\0" : "DelayInhibited\0"); return 0; } @@ -182,7 +182,7 @@ int inhibitor_stop(Inhibitor *i) { i->started = false; - manager_send_changed(i->manager, "Inhibited\0"); + manager_send_changed(i->manager, i->mode == INHIBIT_BLOCK ? "BlockInhibited\0" : "DelayInhibited\0"); return 0; } @@ -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