From eeecdae69913500f880d57f02a22a49d8ea89460 Mon Sep 17 00:00:00 2001 From: Daniel Fojt Date: Thu, 11 Jun 2020 20:11:55 +0200 Subject: [PATCH] Properly ignore "trim" failures in swapon(8). When trying to "trim" a swap device that doesn't support this, just ignore particular ioctl() failure and continue activating the swap. This actually matches the behaviour described in swapon(8) manpage. Issue: https://bugs.dragonflybsd.org/issues/3207 --- sbin/swapon/swapon.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sbin/swapon/swapon.c b/sbin/swapon/swapon.c index 3c7fdd7aa9..dee5c0e6f9 100644 --- a/sbin/swapon/swapon.c +++ b/sbin/swapon/swapon.c @@ -345,7 +345,6 @@ trim_volume(char * name) name, (intmax_t)ioarg[0], (intmax_t)ioarg[1]); if (ioctl(fd, DAIOCTRIM, ioarg) < 0) { printf("Device trim failed\n"); - usage (); } close(fd); } -- 2.41.0