Re: [PATCH] fstrim: Return EXIT_FAILURE when FTRIM ioctl fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 05, 2018 at 11:00:06AM -0700, Gwendal Grignou wrote:
> commit 36c370cbf1481aa8724dff8b7b7fec4a8ba9930b add fstrim_filesystem
> that return -1 or 1 depending on the FTRIM ioctl failures.
> Without this change, main() returns -1 if the fstrim_filesystem()
> returns -1.
> Returns EXIT_FAILURE in both cases.

Good catch. Thanks!

I have applied a little bit different solution:
https://github.com/karelzak/util-linux/commit/7afdbb6f0760952c6e4f86d4c73442d1caee96a8

It seems better to not play any games with fstrim_all() return codes
in main() as the function fstrim_all() return MNT_EX_* codes. 

Anyway, I prefer to use EXIT_* macros in main() only.

    Karel


-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux