chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
journald: Do not always record _AUDIT_SESSION and _AUDIT_LOGINUID
[elogind.git]
/
src
/
core
/
swap.c
diff --git
a/src/core/swap.c
b/src/core/swap.c
index dc98f473871114cac7e5b558bc4111e988910c66..b363c5ec092b2814dfbfbbc91f4445eb967499c2 100644
(file)
--- a/
src/core/swap.c
+++ b/
src/core/swap.c
@@
-1242,10
+1242,14
@@
static void swap_shutdown(Manager *m) {
static int swap_enumerate(Manager *m) {
int r;
static int swap_enumerate(Manager *m) {
int r;
- struct epoll_event ev;
assert(m);
if (!m->proc_swaps) {
assert(m);
if (!m->proc_swaps) {
+ struct epoll_event ev = {
+ .events = EPOLLPRI,
+ .data.ptr = &m->swap_watch,
+ };
+
m->proc_swaps = fopen("/proc/swaps", "re");
if (!m->proc_swaps)
return (errno == ENOENT) ? 0 : -errno;
m->proc_swaps = fopen("/proc/swaps", "re");
if (!m->proc_swaps)
return (errno == ENOENT) ? 0 : -errno;
@@
-1253,10
+1257,6
@@
static int swap_enumerate(Manager *m) {
m->swap_watch.type = WATCH_SWAP;
m->swap_watch.fd = fileno(m->proc_swaps);
m->swap_watch.type = WATCH_SWAP;
m->swap_watch.fd = fileno(m->proc_swaps);
- zero(ev);
- ev.events = EPOLLPRI;
- ev.data.ptr = &m->swap_watch;
-
if (epoll_ctl(m->epoll_fd, EPOLL_CTL_ADD, m->swap_watch.fd, &ev) < 0)
return -errno;
}
if (epoll_ctl(m->epoll_fd, EPOLL_CTL_ADD, m->swap_watch.fd, &ev) < 0)
return -errno;
}