aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2020-02-05 15:37:16 -0800
committerRob Landley <rob@landley.net>2020-02-11 09:00:43 -0600
commit8cfcf6d01d86655efec09353fb8f4db0c65e420a (patch)
tree11714cc1c2a1c11fbdc351711505c47328986b59 /toys
parent7d15b37b5c23c628929f161dc7df9121c6070cec (diff)
downloadtoybox-8cfcf6d01d86655efec09353fb8f4db0c65e420a.tar.gz
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.
Diffstat (limited to 'toys')
-rw-r--r--toys/other/lsattr.c1
1 files changed, 0 insertions, 1 deletions
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.
}