summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Eckhardt <doomster@knuut.de>2010-02-21 20:12:01 +0100
committerUlrich Eckhardt <doomster@knuut.de>2010-02-21 20:12:01 +0100
commitb808b9acc254027fa881c3123ab1b73984e2c1dd (patch)
tree03d628842af928796156320ef7336433ca8d2b4f
parent293a8f011bc74b9089cff8c1a52e51d4cb578b2d (diff)
downloadxine-lib-b808b9acc254027fa881c3123ab1b73984e2c1dd.tar.gz
xine-lib-b808b9acc254027fa881c3123ab1b73984e2c1dd.tar.bz2
Avoid invalid fstat calls when opening empty files
When opening empty files with xine, it reports: > This is xine (X11 gui) - a free video player v0.99.6cvs. > (c) 2000-2007 The xine Team. > system call fstat: Bad file descriptor > system call fstat: Bad file descriptor > call failed > object not accessible > object not accessible > call failed The problem was that when detecting an empty file, it is closed, but the file descriptor in struct file_input_plugin_t is still left at the previous value, causing the errors when it is used later.
-rw-r--r--src/input/input_file.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/input/input_file.c b/src/input/input_file.c
index 208a5420e..b0da2565d 100644
--- a/src/input/input_file.c
+++ b/src/input/input_file.c
@@ -409,6 +409,7 @@ static int file_plugin_open (input_plugin_t *this_gen ) {
if (file_plugin_get_length (this_gen) == 0) {
_x_message(this->stream, XINE_MSG_FILE_EMPTY, this->mrl, NULL);
close (this->fh);
+ this->fh = -1;
xine_log (this->stream->xine, XINE_LOG_MSG,
_("input_file: File empty: >%s<\n"), this->mrl);
return -1;