From 205ec3279d32a152f6046ecc6ad66c39f097fa4d Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Wed, 25 Apr 2007 19:53:34 +0000 Subject: Make recording complain about every little file I/O problem (error on close() failure and fsync() failure). Why? I guess we will find out the disk is full about 1/2 sector sooner on average when the file APIs actually detect this correctly. :/ git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13262 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/wav_enc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'apps/codecs/wav_enc.c') diff --git a/apps/codecs/wav_enc.c b/apps/codecs/wav_enc.c index ff77f137d2..a11aaa07d6 100644 --- a/apps/codecs/wav_enc.c +++ b/apps/codecs/wav_enc.c @@ -169,13 +169,12 @@ static bool on_end_file(struct enc_file_event_data *data) hdr.data_size = htole32(data_size); if (ci->lseek(data->rec_file, 0, SEEK_SET) != 0 || - ci->write(data->rec_file, &hdr, sizeof (hdr)) != sizeof (hdr)) + ci->write(data->rec_file, &hdr, sizeof (hdr)) != sizeof (hdr) || + ci->close(data->rec_file) != 0) { return false; } - ci->fsync(data->rec_file); - ci->close(data->rec_file); data->rec_file = -1; return true; -- cgit v1.2.3