From: Brian J. Murrell Date: Tue, 31 Aug 2010 19:13:00 +0000 (+0400) Subject: b=22978 better conformation to coding standards X-Git-Tag: 2.0.51.0~11 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=c24ae3c9f9d4470394e74038215fed01be4bc3b1 b=22978 better conformation to coding standards Per adilger: - the preferred Lustre coding style is to not use assignments inside conditionals - Lustre coding style recommends against using negation on non-boolean values - while fixing this code, we may as well print the flag in octal, which is how it is normally defined. i=whitebear i=panda --- diff --git a/lustre/liblustre/tests/sanity.c b/lustre/liblustre/tests/sanity.c index ca41add..cc57683 100644 --- a/lustre/liblustre/tests/sanity.c +++ b/lustre/liblustre/tests/sanity.c @@ -707,8 +707,9 @@ int t21(char *name) } t_fcntl(fd, F_SETFL, O_APPEND); - if (!((ret = t_fcntl(fd, F_GETFL)) & O_APPEND)) { - printf("error get flag: ret %x\n", ret); + ret = t_fcntl(fd, F_GETFL); + if ((ret & O_APPEND) == 0) { + printf("error get flag: ret %o\n", ret); return(-1); }