summaryrefslogtreecommitdiff
path: root/apps/codecs
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
parent2a2b8d8a8234633779dca0fff5e7ce23ad4c48ed (diff)
downloadrockbox-205ec3279d32a152f6046ecc6ad66c39f097fa4d.zip
rockbox-205ec3279d32a152f6046ecc6ad66c39f097fa4d.tar.gz
rockbox-205ec3279d32a152f6046ecc6ad66c39f097fa4d.tar.bz2
rockbox-205ec3279d32a152f6046ecc6ad66c39f097fa4d.tar.xz
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')
-rw-r--r--apps/codecs/aiff_enc.c5
-rw-r--r--apps/codecs/mp3_enc.c4
-rw-r--r--apps/codecs/wav_enc.c5
-rw-r--r--apps/codecs/wavpack_enc.c5
4 files changed, 7 insertions, 12 deletions
diff --git a/apps/codecs/aiff_enc.c b/apps/codecs/aiff_enc.c
index 2292bcc..51c4344 100644
--- a/apps/codecs/aiff_enc.c
+++ b/apps/codecs/aiff_enc.c
@@ -181,13 +181,12 @@ static bool on_end_file(struct enc_file_event_data *data)
hdr.ssnd_size = htobe32(data_size + 8);
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;
diff --git a/apps/codecs/mp3_enc.c b/apps/codecs/mp3_enc.c
index daa6cfe..08cbb18 100644
--- a/apps/codecs/mp3_enc.c
+++ b/apps/codecs/mp3_enc.c
@@ -2329,11 +2329,9 @@ static bool on_start_file(struct enc_file_event_data *data)
static bool on_end_file(struct enc_file_event_data *data)
{
- if (!is_file_data_ok(data))
+ if (!is_file_data_ok(data) || ci->close(data->rec_file) != 0)
return false;
- ci->fsync(data->rec_file);
- ci->close(data->rec_file);
data->rec_file = -1;
return true;
diff --git a/apps/codecs/wav_enc.c b/apps/codecs/wav_enc.c
index ff77f13..a11aaa0 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;
diff --git a/apps/codecs/wavpack_enc.c b/apps/codecs/wavpack_enc.c
index 7b6484d..744b987 100644
--- a/apps/codecs/wavpack_enc.c
+++ b/apps/codecs/wavpack_enc.c
@@ -294,13 +294,12 @@ static bool on_end_file(struct enc_file_event_data *data)
ci->write(data->rec_file, &h.wpmdh, sizeof (h.wpmdh))
!= sizeof (h.wpmdh) ||
ci->write(data->rec_file, &h.rhdr, sizeof (h.rhdr))
- != sizeof (h.rhdr))
+ != sizeof (h.rhdr) ||
+ ci->close(data->rec_file) != 0 )
{
return false;
}
- ci->fsync(data->rec_file);
- ci->close(data->rec_file);
data->rec_file = -1;
return true;