[systemd-devel] [PATCH] swap: ignore missing /proc/swaps
Michael Olbrich
m.olbrich at pengutronix.de
Fri Jun 24 04:43:19 PDT 2011
Otherwise systemd reports "Failed to fully start up daemon: No such file or
directory" when swap is disabled in the kernel.
---
src/swap.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/swap.c b/src/swap.c
index 04df585..d1f5237 100644
--- a/src/swap.c
+++ b/src/swap.c
@@ -1237,7 +1237,7 @@ static int swap_enumerate(Manager *m) {
if (!m->proc_swaps) {
if (!(m->proc_swaps = fopen("/proc/swaps", "re")))
- return -errno;
+ return (errno == ENOENT) ? 0 : -errno;
m->swap_watch.type = WATCH_SWAP;
m->swap_watch.fd = fileno(m->proc_swaps);
--
1.7.5.3
More information about the systemd-devel
mailing list