mirror of
https://github.com/sheumann/hush.git
synced 2024-12-27 01:32:08 +00:00
swapon: skip noauto entries
Signed-off-by: Lauri Kasanen <curaga@operamail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
a659b81dfa
commit
d2844fcb68
@ -66,11 +66,20 @@ static int do_em_all(void)
|
|||||||
bb_perror_msg_and_die("/etc/fstab");
|
bb_perror_msg_and_die("/etc/fstab");
|
||||||
|
|
||||||
err = 0;
|
err = 0;
|
||||||
while ((m = getmntent(f)) != NULL)
|
while ((m = getmntent(f)) != NULL) {
|
||||||
if (strcmp(m->mnt_type, MNTTYPE_SWAP) == 0)
|
if (strcmp(m->mnt_type, MNTTYPE_SWAP) == 0) {
|
||||||
err += swap_enable_disable(m->mnt_fsname);
|
/* swapon -a should ignore entries with noauto,
|
||||||
|
* but swapoff -a should process them */
|
||||||
|
if (applet_name[5] != 'n'
|
||||||
|
|| hasmntopt(m, MNTOPT_NOAUTO) == NULL
|
||||||
|
) {
|
||||||
|
err += swap_enable_disable(m->mnt_fsname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
endmntent(f);
|
if (ENABLE_FEATURE_CLEAN_UP)
|
||||||
|
endmntent(f);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user