summaryrefslogtreecommitdiffstats
path: root/apps/codecs/mp3_enc.c
diff options
context:
space:
mode:
authorPeter D'Hoye <peter.dhoye@gmail.com>2007-12-13 23:36:22 +0000
committerPeter D'Hoye <peter.dhoye@gmail.com>2007-12-13 23:36:22 +0000
commiteb947cdde1a34588de767ea75762269253af487a (patch)
tree742ba8891394103004bf37666829c2ba128bc603 /apps/codecs/mp3_enc.c
parent10d0344e296eeb9259e9b609bb9b656ba1d7e42a (diff)
downloadrockbox-eb947cdde1a34588de767ea75762269253af487a.tar.gz
rockbox-eb947cdde1a34588de767ea75762269253af487a.zip
Another fix for file system issues when encountering disk full (like when recording)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15920 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/mp3_enc.c')
-rw-r--r--apps/codecs/mp3_enc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/codecs/mp3_enc.c b/apps/codecs/mp3_enc.c
index 2dc9bcbb3d..26cc1dd73f 100644
--- a/apps/codecs/mp3_enc.c
+++ b/apps/codecs/mp3_enc.c
@@ -2329,6 +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 (data->rec_file < 0)
+ return false; /* file already closed, nothing more we can do */
+
/* always _try_ to write the file header, even on error */
if (ci->close(data->rec_file) != 0)
return false;