
29 Aug
2008
29 Aug
'08
9:14 a.m.
"Daniel P. Berrange" <berrange@redhat.com> wrote: ...
+/* Like virFileReadLimFP, but use a file descriptor rather than a FILE*. */ +int __virFileReadLimFD(int fd_arg, int maxlen, char **buf) +{ + int fd = dup (fd_arg); + if (0 <= fd) {
Can we stick to 'fd >= 0' or 'fd < 0' or 'fd == -1'. I find the reversed constant-first conditionals rather painful to read. Always have to stop and think about them for too long.
Sure. I've just adjusted it like this: - if (0 <= fd) { + if (fd >= 0) {