summaryrefslogtreecommitdiff
path: root/apps/playlist.c
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2005-01-20 16:24:26 +0000
committerBjörn Stenberg <bjorn@haxx.se>2005-01-20 16:24:26 +0000
commit30d8f6192ff8217afb7d9bf0722dfd2c66a4d599 (patch)
tree8ec22be7b19a98d74ac7d6ea3f77db106d6b46dd /apps/playlist.c
parentbe7452d31eee7d2cc78c371d0dca885167922e44 (diff)
downloadrockbox-30d8f6192ff8217afb7d9bf0722dfd2c66a4d599.zip
rockbox-30d8f6192ff8217afb7d9bf0722dfd2c66a4d599.tar.gz
rockbox-30d8f6192ff8217afb7d9bf0722dfd2c66a4d599.tar.bz2
rockbox-30d8f6192ff8217afb7d9bf0722dfd2c66a4d599.tar.xz
Added music playing from ID3 browser.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5616 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/playlist.c')
-rw-r--r--apps/playlist.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index 651a5af..924b904 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -244,7 +244,8 @@ static void new_playlist(struct playlist_info* playlist, const char *dir,
*/
static void create_control(struct playlist_info* playlist)
{
- playlist->control_fd = creat(playlist->control_filename, 0000200);
+ playlist->control_fd = open(playlist->control_filename,
+ O_CREAT|O_RDWR|O_TRUNC);
if (playlist->control_fd < 0)
{
if (check_rockboxdir())
@@ -950,18 +951,19 @@ static int get_filename(struct playlist_info* playlist, int seek,
if (control_file)
mutex_lock(&playlist->control_mutex);
- lseek(fd, seek, SEEK_SET);
- max = read(fd, tmp_buf, buf_length);
+ if (lseek(fd, seek, SEEK_SET) != seek)
+ max = -1;
+ else
+ max = read(fd, tmp_buf, buf_length);
if (control_file)
- mutex_unlock(&playlist->control_mutex);
+ mutex_unlock(&playlist->control_mutex);
}
if (max < 0)
{
if (control_file)
- splash(HZ*2, true,
- str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
+ splash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
else
splash(HZ*2, true, str(LANG_PLAYLIST_ACCESS_ERROR));