summaryrefslogtreecommitdiff
path: root/apps/codecs/wav_enc.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-04-25 19:53:34 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-04-25 19:53:34 +0000
commit205ec3279d32a152f6046ecc6ad66c39f097fa4d (patch)
treefa8bb607ebae23a0b43428ea6850797af83b57a0 /apps/codecs/wav_enc.c
parent2a2b8d8a8234633779dca0fff5e7ce23ad4c48ed (diff)
downloadrockbox-205ec3279d32a152f6046ecc6ad66c39f097fa4d.tar.gz
rockbox-205ec3279d32a152f6046ecc6ad66c39f097fa4d.zip
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
Diffstat (limited to 'apps/codecs/wav_enc.c')
-rw-r--r--apps/codecs/wav_enc.c5
1 files changed, 2 insertions, 3 deletions
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)
169 hdr.data_size = htole32(data_size); 169 hdr.data_size = htole32(data_size);
170 170
171 if (ci->lseek(data->rec_file, 0, SEEK_SET) != 0 || 171 if (ci->lseek(data->rec_file, 0, SEEK_SET) != 0 ||
172 ci->write(data->rec_file, &hdr, sizeof (hdr)) != sizeof (hdr)) 172 ci->write(data->rec_file, &hdr, sizeof (hdr)) != sizeof (hdr) ||
173 ci->close(data->rec_file) != 0)
173 { 174 {
174 return false; 175 return false;
175 } 176 }
176 177
177 ci->fsync(data->rec_file);
178 ci->close(data->rec_file);
179 data->rec_file = -1; 178 data->rec_file = -1;
180 179
181 return true; 180 return true;