From 8cfcf6d01d86655efec09353fb8f4db0c65e420a Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 5 Feb 2020 15:37:16 -0800 Subject: chattr: fix exit status, redo the tests. The e2fsprogs chattr(1) returns failure when it fails to do what was asked of it, and so should we. Fixing this then reveals a lot of issues with the tests that were being accidentally swept under the carpet. The bulk of this patch is going through all the tests, removing the duplicates and making the remaining tests more thorough. I've tested this on ext4 and f2fs on a variety of 4.x and 5.x kernel versions (but nothing older). We might need to reduce the list of attribtues we try to toggle, but the more thorough tests use well-supported attributes. I've also fixed the -R test to actually involve a directory hierarchy. --- toys/other/lsattr.c | 1 - 1 file changed, 1 deletion(-) (limited to 'toys/other/lsattr.c') diff --git a/toys/other/lsattr.c b/toys/other/lsattr.c index 090ac318..cd236b9e 100644 --- a/toys/other/lsattr.c +++ b/toys/other/lsattr.c @@ -353,5 +353,4 @@ void chattr_main(void) if (!(TT.add || TT.rm || TT.set || FLAG(p) || FLAG(v))) error_exit("need '-p', '-v', '=', '-', or '+'"); for (; *argv; argv++) dirtree_read(*argv, update_attr); - toys.exitval = 0; //always set success at this point. } -- cgit v1.2.3