[systemd-commits] src/swap.c

Lennart Poettering lennart at kemper.freedesktop.org
Mon Jun 27 05:33:01 PDT 2011


 src/swap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3f8587327556c97ae4fc4c8b3ea0df122f769d4b
Author: Michael Olbrich <m.olbrich at pengutronix.de>
Date:   Fri Jun 24 13:43:19 2011 +0200

    swap: ignore missing /proc/swaps
    
    Otherwise systemd reports "Failed to fully start up daemon: No such file or
    directory" when swap is disabled in the kernel.

diff --git a/src/swap.c b/src/swap.c
index 14719ad..7675e6a 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);



More information about the systemd-commits mailing list