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.
This commit is contained in:
Michael Olbrich 2011-06-24 13:43:19 +02:00 committed by Lennart Poettering
parent 1616acbba4
commit 3f85873275

View file

@ -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);