diff options
Diffstat (limited to 'apps/playlist.c')
-rw-r--r-- | apps/playlist.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index 651a5afeea..924b9041e8 100644 --- a/apps/playlist.c +++ b/apps/playlist.c | |||
@@ -244,7 +244,8 @@ static void new_playlist(struct playlist_info* playlist, const char *dir, | |||
244 | */ | 244 | */ |
245 | static void create_control(struct playlist_info* playlist) | 245 | static void create_control(struct playlist_info* playlist) |
246 | { | 246 | { |
247 | playlist->control_fd = creat(playlist->control_filename, 0000200); | 247 | playlist->control_fd = open(playlist->control_filename, |
248 | O_CREAT|O_RDWR|O_TRUNC); | ||
248 | if (playlist->control_fd < 0) | 249 | if (playlist->control_fd < 0) |
249 | { | 250 | { |
250 | if (check_rockboxdir()) | 251 | if (check_rockboxdir()) |
@@ -950,18 +951,19 @@ static int get_filename(struct playlist_info* playlist, int seek, | |||
950 | if (control_file) | 951 | if (control_file) |
951 | mutex_lock(&playlist->control_mutex); | 952 | mutex_lock(&playlist->control_mutex); |
952 | 953 | ||
953 | lseek(fd, seek, SEEK_SET); | 954 | if (lseek(fd, seek, SEEK_SET) != seek) |
954 | max = read(fd, tmp_buf, buf_length); | 955 | max = -1; |
956 | else | ||
957 | max = read(fd, tmp_buf, buf_length); | ||
955 | 958 | ||
956 | if (control_file) | 959 | if (control_file) |
957 | mutex_unlock(&playlist->control_mutex); | 960 | mutex_unlock(&playlist->control_mutex); |
958 | } | 961 | } |
959 | 962 | ||
960 | if (max < 0) | 963 | if (max < 0) |
961 | { | 964 | { |
962 | if (control_file) | 965 | if (control_file) |
963 | splash(HZ*2, true, | 966 | splash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); |
964 | str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR)); | ||
965 | else | 967 | else |
966 | splash(HZ*2, true, str(LANG_PLAYLIST_ACCESS_ERROR)); | 968 | splash(HZ*2, true, str(LANG_PLAYLIST_ACCESS_ERROR)); |
967 | 969 | ||