The patch add error handling to functions with 'warn_unused_result' return value
such as write, read, ftruncate, and realpath.