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.
This commit is contained in:
Michael Olbrich 2011-06-28 09:30:08 +02:00 committed by Lennart Poettering
parent e05b415e95
commit dee87d612d

View file

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