chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move part of logind.c into a separate file
[elogind.git]
/
src
/
login
/
logind-action.c
diff --git
a/src/login/logind-action.c
b/src/login/logind-action.c
index a796ebe9eca24ab2842f4c564eebac8d0dffd517..74114ee0a126aede7f2dc48a137ba44b138d7fc8 100644
(file)
--- a/
src/login/logind-action.c
+++ b/
src/login/logind-action.c
@@
-21,10
+21,13
@@
#include <unistd.h>
#include <unistd.h>
+#include <systemd/sd-messages.h>
+
#include "conf-parser.h"
#include "special.h"
#include "dbus-common.h"
#include "logind-action.h"
#include "conf-parser.h"
#include "special.h"
#include "dbus-common.h"
#include "logind-action.h"
+#include "sleep-config.h"
int manager_handle_action(
Manager *m,
int manager_handle_action(
Manager *m,
@@
-60,7
+63,7
@@
int manager_handle_action(
assert(m);
assert(m);
- if (m->action_
job || m->delayed_uni
t) {
+ if (m->action_
wha
t) {
log_debug("Action already in progress, ignoring.");
return -EALREADY;
}
log_debug("Action already in progress, ignoring.");
return -EALREADY;
}
@@
-72,13
+75,13
@@
int manager_handle_action(
}
if (handle == HANDLE_SUSPEND)
}
if (handle == HANDLE_SUSPEND)
- supported = can_sleep("
mem
") > 0;
+ supported = can_sleep("
suspend
") > 0;
else if (handle == HANDLE_HIBERNATE)
else if (handle == HANDLE_HIBERNATE)
- supported = can_sleep("
disk
") > 0;
+ supported = can_sleep("
hibernate
") > 0;
else if (handle == HANDLE_HYBRID_SLEEP)
else if (handle == HANDLE_HYBRID_SLEEP)
- supported = can_sleep("
disk") > 0 && can_sleep_disk("suspend
") > 0;
+ supported = can_sleep("
hybrid-sleep
") > 0;
else if (handle == HANDLE_KEXEC)
else if (handle == HANDLE_KEXEC)
- supported = access(
"/sbin/kexec"
, X_OK) >= 0;
+ supported = access(
KEXEC
, X_OK) >= 0;
else
supported = true;
else
supported = true;