From c24ae3c9f9d4470394e74038215fed01be4bc3b1 Mon Sep 17 00:00:00 2001 From: "Brian J. Murrell" Date: Tue, 31 Aug 2010 23:13:00 +0400 Subject: [PATCH] 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 --- lustre/liblustre/tests/sanity.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); } -- 1.8.3.1