f2fs_io: add helper functions for handling errors
authorEric Biggers <ebiggers@google.com>
Fri, 4 Oct 2019 22:43:16 +0000 (15:43 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 7 Oct 2019 16:24:44 +0000 (09:24 -0700)
commit7a9422f092ca727abff9c37dc133897405983038
tree5d2c7ae4b49597a1bd3ee8002016e55d73c909f3
parent696bf1ea4000c2ff9161a4929d6bd5b27a698933
f2fs_io: add helper functions for handling errors

Add and use helper functions for:

- Printing an error message (optionally with errno) and exiting.
- Allocating memory, exiting on error.
- Opening a file, exiting on error.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
tools/f2fs_io/f2fs_io.c