From dcd27abcc4471ac04d7f196905907eb9a28bf0d8 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 5 Oct 2009 03:03:07 +0200 Subject: unpackers: check errors from close() too Signed-off-by: Denys Vlasenko --- libbb/xfuncs_printf.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libbb') diff --git a/libbb/xfuncs_printf.c b/libbb/xfuncs_printf.c index 5f56b36..aaf9989 100644 --- a/libbb/xfuncs_printf.c +++ b/libbb/xfuncs_printf.c @@ -213,6 +213,12 @@ void FAST_FUNC xwrite_str(int fd, const char *str) xwrite(fd, str, strlen(str)); } +void FAST_FUNC xclose(int fd) +{ + if (close(fd)) + bb_perror_msg_and_die("close failed"); +} + // Die with an error message if we can't lseek to the right spot. off_t FAST_FUNC xlseek(int fd, off_t offset, int whence) { -- cgit v1.1