From b66fa58328888998b9085d379d8a40c1b23588fa Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 19 Aug 2019 19:30:15 -0500 Subject: Tiny cleanup, net two lines shorter. --- toys/other/lsattr.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'toys/other/lsattr.c') diff --git a/toys/other/lsattr.c b/toys/other/lsattr.c index ec7d88e5..5a102011 100644 --- a/toys/other/lsattr.c +++ b/toys/other/lsattr.c @@ -288,15 +288,13 @@ static int update_attr(struct dirtree *root) if (ext2_setflag(fd, &(root->st), fval) < 0) perror_msg("setting flags '%s'", fpath); } - if (chattr.vflag) { // set file version - if (ioctl(fd, FS_IOC_SETVERSION, (void*)&chattr.version) < 0) - perror_msg("while setting version on '%s'", fpath); - } + // set file version + if (chattr.vflag && (ioctl(fd, FS_IOC_SETVERSION, &chattr.version)<0)) + perror_msg("while setting version on '%s'", fpath); free(fpath); xclose(fd); - if (S_ISDIR(root->st.st_mode) && chattr.recursive) return DIRTREE_RECURSE; - return 0; + return (S_ISDIR(root->st.st_mode) && chattr.recursive) ? DIRTREE_RECURSE : 0; } void chattr_main(void) -- cgit v1.2.3