Closed isomer closed 5 years ago
posix_memalign returns +errno on error, not -1 or -errno, and ior_peak directly returns the return value of posix_memalign, causing the calling function to believe that some data was returned, instead of an IO error.
Reproduction steps:
bash -c 'ulimit -Sv $[ 64 << 10 ]; wandiocat /etc/motd'
Fix: Line ~115 of ior-peak.c should have errno = ret; return -1; instead of return ret;
errno = ret; return -1;
return ret;
Should be fixed in 73d72ed4dbdc25a1ba1140cb2cacb48dcfd831e9.
posix_memalign returns +errno on error, not -1 or -errno, and ior_peak directly returns the return value of posix_memalign, causing the calling function to believe that some data was returned, instead of an IO error.
Reproduction steps:
Fix: Line ~115 of ior-peak.c should have
errno = ret; return -1;
instead ofreturn ret;