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
}
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);
}