diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-05 03:03:07 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-05 03:03:07 +0200 |
commit | dcd27abcc4471ac04d7f196905907eb9a28bf0d8 (patch) | |
tree | 24ed60e8325dcfccc99b36b5cab663cd693f29bf /libbb/xfuncs_printf.c | |
parent | be168b119750beacc0d0212607c6fa3ee87f238c (diff) | |
download | busybox-w32-dcd27abcc4471ac04d7f196905907eb9a28bf0d8.tar.gz busybox-w32-dcd27abcc4471ac04d7f196905907eb9a28bf0d8.tar.bz2 busybox-w32-dcd27abcc4471ac04d7f196905907eb9a28bf0d8.zip |
unpackers: check errors from close() too
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/xfuncs_printf.c')
-rw-r--r-- | libbb/xfuncs_printf.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libbb/xfuncs_printf.c b/libbb/xfuncs_printf.c index 5f56b36de..aaf9989a0 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) | |||
213 | xwrite(fd, str, strlen(str)); | 213 | xwrite(fd, str, strlen(str)); |
214 | } | 214 | } |
215 | 215 | ||
216 | void FAST_FUNC xclose(int fd) | ||
217 | { | ||
218 | if (close(fd)) | ||
219 | bb_perror_msg_and_die("close failed"); | ||
220 | } | ||
221 | |||
216 | // Die with an error message if we can't lseek to the right spot. | 222 | // Die with an error message if we can't lseek to the right spot. |
217 | off_t FAST_FUNC xlseek(int fd, off_t offset, int whence) | 223 | off_t FAST_FUNC xlseek(int fd, off_t offset, int whence) |
218 | { | 224 | { |