chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Compiling.
[elogind.git]
/
src
/
login
/
logind.c
diff --git
a/src/login/logind.c
b/src/login/logind.c
index 78220ff4dd8a81e4cdd86ce62a0f3057b8e5ba55..e7880743a0657566c5ceea18cbb56c31ee627ff3 100644
(file)
--- a/
src/login/logind.c
+++ b/
src/login/logind.c
@@
-24,13
+24,10
@@
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
-#include <linux/vt.h>
-#include <sys/timerfd.h>
#include "sd-daemon.h"
#include "strv.h"
#include "conf-parser.h"
#include "sd-daemon.h"
#include "strv.h"
#include "conf-parser.h"
-#include "mkdir.h"
#include "bus-util.h"
#include "bus-error.h"
#include "logind.h"
#include "bus-util.h"
#include "bus-error.h"
#include "logind.h"
@@
-57,6
+54,7
@@
Manager *manager_new(void) {
m->handle_lid_switch = HANDLE_SUSPEND;
m->handle_lid_switch_docked = HANDLE_IGNORE;
m->lid_switch_ignore_inhibited = true;
m->handle_lid_switch = HANDLE_SUSPEND;
m->handle_lid_switch_docked = HANDLE_IGNORE;
m->lid_switch_ignore_inhibited = true;
+ m->holdoff_timeout_usec = 30 * USEC_PER_SEC;
m->idle_action_usec = 30 * USEC_PER_MINUTE;
m->idle_action = HANDLE_IGNORE;
m->idle_action_usec = 30 * USEC_PER_MINUTE;
m->idle_action = HANDLE_IGNORE;
@@
-290,7
+288,7
@@
static int manager_enumerate_seats(Manager *m) {
if (errno == ENOENT)
return 0;
if (errno == ENOENT)
return 0;
- log_error
(
"Failed to open /run/systemd/seats: %m");
+ log_error
_errno(errno,
"Failed to open /run/systemd/seats: %m");
return -errno;
}
return -errno;
}
@@
-327,7
+325,7
@@
static int manager_enumerate_linger_users(Manager *m) {
if (errno == ENOENT)
return 0;
if (errno == ENOENT)
return 0;
- log_error
(
"Failed to open /var/lib/systemd/linger/: %m");
+ log_error
_errno(errno,
"Failed to open /var/lib/systemd/linger/: %m");
return -errno;
}
return -errno;
}
@@
-363,7
+361,7
@@
static int manager_enumerate_users(Manager *m) {
if (errno == ENOENT)
return 0;
if (errno == ENOENT)
return 0;
- log_error
(
"Failed to open /run/systemd/users: %m");
+ log_error
_errno(errno,
"Failed to open /run/systemd/users: %m");
return -errno;
}
return -errno;
}
@@
-404,7
+402,7
@@
static int manager_enumerate_sessions(Manager *m) {
if (errno == ENOENT)
return 0;
if (errno == ENOENT)
return 0;
- log_error
(
"Failed to open /run/systemd/sessions: %m");
+ log_error
_errno(errno,
"Failed to open /run/systemd/sessions: %m");
return -errno;
}
return -errno;
}
@@
-451,7
+449,7
@@
static int manager_enumerate_inhibitors(Manager *m) {
if (errno == ENOENT)
return 0;
if (errno == ENOENT)
return 0;
- log_error
(
"Failed to open /run/systemd/inhibit: %m");
+ log_error
_errno(errno,
"Failed to open /run/systemd/inhibit: %m");
return -errno;
}
return -errno;
}
@@
-568,7
+566,7
@@
static int manager_reserve_vt(Manager *m) {
/* Don't complain on VT-less systems */
if (errno != ENOENT)
/* Don't complain on VT-less systems */
if (errno != ENOENT)
- log_warning
(
"Failed to pin reserved VT: %m");
+ log_warning
_errno(errno,
"Failed to pin reserved VT: %m");
return -errno;
}
return -errno;
}
@@
-753,7
+751,7
@@
static int manager_connect_console(Manager *m) {
if (errno == ENOENT)
return 0;
if (errno == ENOENT)
return 0;
- log_error
(
"Failed to open /sys/class/tty/tty0/active: %m");
+ log_error
_errno(errno,
"Failed to open /sys/class/tty/tty0/active: %m");
return -errno;
}
return -errno;
}
@@
-1032,7
+1030,7
@@
int manager_startup(Manager *m) {
if (r < 0)
return log_error_errno(r, "Failed to add seat0: %m");
if (r < 0)
return log_error_errno(r, "Failed to add seat0: %m");
- r = manager_set_lid_switch_ignore(m, 0 +
IGNORE_LID_SWITCH_STARTUP_USEC
);
+ r = manager_set_lid_switch_ignore(m, 0 +
m->holdoff_timeout_usec
);
if (r < 0)
log_warning_errno(r, "Failed to set up lid switch ignore event source: %m");
if (r < 0)
log_warning_errno(r, "Failed to set up lid switch ignore event source: %m");