From: Michael Olbrich Date: Tue, 28 Jun 2011 07:30:08 +0000 (+0200) Subject: umount: ignore missing /proc/swaps X-Git-Tag: v30~68 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=dee87d612d295d9c8642b76c716b8e357411e65a umount: ignore missing /proc/swaps /proc/swaps does not exist when swap is disabled in the kernel. Just report an empty list of mountpoints to unmount in this case. --- diff --git a/src/umount.c b/src/umount.c index 3d328e0da..95efa8204 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");