libaio-0.3.109-testcase-8.patch 579 B

1234567891011121314151617181920
  1. Do not ignore return value of ftruncate(): testcases are compiled with -Werror,
  2. and ftruncate is declared with attribute warn_unused_result.
  3. --- harness/cases/8.t.orig 2012-03-09 16:40:04.074168070 +0100
  4. +++ harness/cases/8.t 2012-03-09 16:40:57.777278646 +0100
  5. @@ -9,12 +9,13 @@
  6. {
  7. long long min = 0, max = 9223372036854775807LL;
  8. char c = 0;
  9. + int ret;
  10. while (max - min > 1) {
  11. if (pwrite64(fd, &c, 1, (min + max) / 2) == -1)
  12. max = (min + max) / 2;
  13. else {
  14. - ftruncate(fd, 0);
  15. + ret = ftruncate(fd, 0); assert(ret == 0);
  16. min = (min + max) / 2;
  17. }
  18. }