summaryrefslogtreecommitdiffstats
path: root/disk-utils/mkswap.c
diff options
context:
space:
mode:
authorLubomir Rintel2016-04-18 09:01:23 +0200
committerKarel Zak2016-04-18 10:51:28 +0200
commitd97dc0ee2505e80c8e9fca89aa2001b2ec2c3695 (patch)
tree6ff57fec42149212068cce7123b8012c5cbf33e3 /disk-utils/mkswap.c
parentlibmount: make kernel_fs_postparse() more robust (diff)
downloadkernel-qcow2-util-linux-d97dc0ee2505e80c8e9fca89aa2001b2ec2c3695.tar.gz
kernel-qcow2-util-linux-d97dc0ee2505e80c8e9fca89aa2001b2ec2c3695.tar.xz
kernel-qcow2-util-linux-d97dc0ee2505e80c8e9fca89aa2001b2ec2c3695.zip
mkswap: tolerate ENOTSUP when failing to relabel
It might be that the underlying filesystem just doesn't support SELinux labeling. This fixes creating swap on vfat live media: # livecd-iso-to-disk.sh --msdos --swap-size-mb 666 ... Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Diffstat (limited to 'disk-utils/mkswap.c')
-rw-r--r--disk-utils/mkswap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c
index a7c6a709b..e44d039e1 100644
--- a/disk-utils/mkswap.c
+++ b/disk-utils/mkswap.c
@@ -522,7 +522,7 @@ int main(int argc, char **argv)
context_string = context_str(newcontext);
if (strcmp(context_string, oldcontext)!=0) {
- if (fsetfilecon(ctl.fd, context_string))
+ if (fsetfilecon(ctl.fd, context_string) && errno != ENOTSUP)
err(EXIT_FAILURE, _("unable to relabel %s to %s"),
ctl.devname, context_string);
}