Whamcloud - gitweb
b=22978 better conformation to coding standards
authorBrian J. Murrell <brian.murrell@oracle.com>
Tue, 31 Aug 2010 19:13:00 +0000 (23:13 +0400)
committerMikhail Pershin <tappro@sun.com>
Mon, 6 Sep 2010 19:23:54 +0000 (23:23 +0400)
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

index ca41add..cc57683 100644 (file)
@@ -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);
         }