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.tar.gz rockbox-ef72f996814301fc0ed9cc358f620e67a81486f7.zip |
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 edf32d227d..46bc0df44d 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include "file.h" | 29 | #include "file.h" |
30 | #include "kernel.h" | 30 | #include "kernel.h" |
31 | #include "sprintf.h" | 31 | #include "sprintf.h" |
32 | #include "logf.h" | ||
32 | #include "screens.h" | 33 | #include "screens.h" |
33 | #include "misc.h" | 34 | #include "misc.h" |
34 | #include "mas.h" | 35 | #include "mas.h" |
@@ -374,15 +375,18 @@ int codec_load_file(const char *plugin, void *parameter) | |||
374 | fd = open(plugin, O_RDONLY); | 375 | fd = open(plugin, O_RDONLY); |
375 | if (fd < 0) { | 376 | if (fd < 0) { |
376 | snprintf(msgbuf, sizeof(msgbuf)-1, "Couldn't load codec: %s", plugin); | 377 | snprintf(msgbuf, sizeof(msgbuf)-1, "Couldn't load codec: %s", plugin); |
378 | logf("Codec load error:%d", fd); | ||
377 | splash(HZ*2, true, msgbuf); | 379 | splash(HZ*2, true, msgbuf); |
378 | return fd; | 380 | return fd; |
379 | } | 381 | } |
380 | 382 | ||
381 | rc = read(fd, &pluginbuf[0], PLUGIN_BUFFER_SIZE); | 383 | rc = read(fd, &pluginbuf[0], PLUGIN_BUFFER_SIZE); |
382 | if (rc <= 0) | 384 | close(fd); |
385 | if (rc <= 0) { | ||
386 | logf("Codec read error"); | ||
383 | return PLUGIN_ERROR; | 387 | return PLUGIN_ERROR; |
388 | } | ||
384 | plugin_size = rc; | 389 | plugin_size = rc; |
385 | close(fd); | ||
386 | 390 | ||
387 | return codec_load_ram(pluginbuf, plugin_size, parameter, NULL, 0); | 391 | return codec_load_ram(pluginbuf, plugin_size, parameter, NULL, 0); |
388 | } | 392 | } |