diff options
| author | Miika Pekkarinen <miipekk@ihme.org> | 2005-06-14 14:36:46 +0000 |
|---|---|---|
| committer | Miika Pekkarinen <miipekk@ihme.org> | 2005-06-14 14:36:46 +0000 |
| commit | ef72f996814301fc0ed9cc358f620e67a81486f7 (patch) | |
| tree | 1f866cd2931eb8fff7f0e904934d13f5d49b2a81 /apps/plugin.c | |
| parent | 58c71e0e366c174fd6f71446758fe311e68f4bee (diff) | |
| download | rockbox-ef72f996814301fc0ed9cc358f620e67a81486f7.zip rockbox-ef72f996814301fc0ed9cc358f620e67a81486f7.tar.gz rockbox-ef72f996814301fc0ed9cc358f620e67a81486f7.tar.bz2 rockbox-ef72f996814301fc0ed9cc358f620e67a81486f7.tar.xz | |
Fixed a dead lock, file handle leak that caused wps to jam and
selected a smaller i2c timeout value.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6707 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugin.c')
| -rw-r--r-- | apps/plugin.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/plugin.c b/apps/plugin.c index edf32d2..46bc0df 100644 --- a/apps/plugin.c +++ b/apps/plugin.c @@ -29,6 +29,7 @@ #include "file.h" #include "kernel.h" #include "sprintf.h" +#include "logf.h" #include "screens.h" #include "misc.h" #include "mas.h" @@ -374,15 +375,18 @@ int codec_load_file(const char *plugin, void *parameter) fd = open(plugin, O_RDONLY); if (fd < 0) { snprintf(msgbuf, sizeof(msgbuf)-1, "Couldn't load codec: %s", plugin); + logf("Codec load error:%d", fd); splash(HZ*2, true, msgbuf); return fd; } rc = read(fd, &pluginbuf[0], PLUGIN_BUFFER_SIZE); - if (rc <= 0) + close(fd); + if (rc <= 0) { + logf("Codec read error"); return PLUGIN_ERROR; + } plugin_size = rc; - close(fd); return codec_load_ram(pluginbuf, plugin_size, parameter, NULL, 0); } |