[systemd-devel] [PATCH] umount: ignore missing /proc/swaps

Michael Olbrich m.olbrich at pengutronix.de
Tue Jun 28 00:30:08 PDT 2011


/proc/swaps does not exist when swap is disabled in the kernel.
Just report an empty list of mountpoints to unmount in this case.
---

Hi,

Missed this one, when I made the last patch. This should take care of any
bogus swap error messages during shutdown.

Regards,
Michael Olbrich

 src/umount.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/umount.c b/src/umount.c
index 3d328e0..95efa82 100644
--- a/src/umount.c
+++ b/src/umount.c
@@ -146,7 +146,7 @@ static int swap_list_get(MountPoint **head) {
         assert(head);
 
         if (!(proc_swaps = fopen("/proc/swaps", "re")))
-                return -errno;
+                return (errno == ENOENT) ? 0 : -errno;
 
         (void) fscanf(proc_swaps, "%*s %*s %*s %*s %*s\n");
 
-- 
1.7.5.3



More information about the systemd-devel mailing list