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:
committed by
Lennart Poettering
parent
e05b415e95
commit
dee87d612d
+1
-1
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user