Permalink
Browse files

Fix SAFE_READ so that it actually works

Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
  • Loading branch information...
ngie-eign committed May 20, 2012
1 parent 327655d commit ac0d5ebeb35abc8d9034a6c0d754a1d71162fef7
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/safe_macros.c
View
@@ -222,7 +222,7 @@ safe_read(const char *file, const int lineno, void (*cleanup_fn)(void),
ssize_t rval;
rval = read(fildes, buf, nbyte);
- if ((len_strict == 0 && rval == -1) || rval != nbyte)
+ if (rval == -1 || (len_strict && rval != nbyte))
tst_brkm(TBROK|TERRNO, cleanup_fn, "read failed at %s:%d",
file, lineno);

0 comments on commit ac0d5eb

Please sign in to comment.