projects
/
paraslash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
de4172d
)
vss.c: Don't try to mmap empty files
author
Andre Noll
<maan@systemlinux.org>
Thu, 22 Mar 2007 15:15:42 +0000
(16:15 +0100)
committer
Andre Noll
<maan@systemlinux.org>
Thu, 22 Mar 2007 15:15:42 +0000
(16:15 +0100)
as this causes mmap() to return MAP_FAILED, i.e. para_mmap() calls
exit() so para_server dies, which clearly is inapproriate. Instead,
skip the audio file and try the next one if size == 0.
vss.c
patch
|
blob
|
history
diff --git
a/vss.c
b/vss.c
index 8e9c17bf48a623bd883274ce5f58dfd6a463f264..cb2d16c8d0c84843de9f5be213ed09b752aee890 100644
(file)
--- a/
vss.c
+++ b/
vss.c
@@
-268,7
+268,8
@@
static void vss_get_audio_file(void)
audio_file = open(sl[i], O_RDONLY);
if (audio_file < 0)
continue;
- if (fstat(audio_file, &file_status) == -1) {
+ if (fstat(audio_file, &file_status) == -1 ||
+ !file_status.st_size) {
close(audio_file);
continue;
}