diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-06-15 13:38:01 +0200 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-06-15 13:38:01 +0200 |
commit | a6a94de1633cfae2904c4e984e643e7a657a3645 (patch) | |
tree | b04715779db672b4ce4a8eef0cc6800a7e713e3c | |
parent | b0e29318df931e2651bd28f10087d36026795488 (diff) | |
download | xine-lib-a6a94de1633cfae2904c4e984e643e7a657a3645.tar.gz xine-lib-a6a94de1633cfae2904c4e984e643e7a657a3645.tar.bz2 |
Use an extra compound, and removes one preprocessor block.
-rw-r--r-- | src/input/input_file.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/input/input_file.c b/src/input/input_file.c index d0e067393..dd67d06ed 100644 --- a/src/input/input_file.c +++ b/src/input/input_file.c @@ -359,9 +359,6 @@ static int file_plugin_open (input_plugin_t *this_gen ) { file_input_plugin_t *this = (file_input_plugin_t *) this_gen; char *filename; struct stat sbuf; -#ifdef HAVE_MMAP - size_t tmp_size; -#endif lprintf("file_plugin_open\n"); @@ -426,14 +423,16 @@ static int file_plugin_open (input_plugin_t *this_gen ) { } #ifdef HAVE_MMAP - tmp_size = sbuf.st_size; /* may cause truncation - if it does, DON'T mmap! */ - if ((tmp_size == sbuf.st_size) && - ( (this->mmap_base = mmap(NULL, tmp_size, PROT_READ, MAP_SHARED, this->fh, 0)) != (void*)-1 )) { - this->mmap_on = 1; - this->mmap_curr = this->mmap_base; - this->mmap_len = sbuf.st_size; - } else { - this->mmap_base = NULL; + { + size_t tmp_size = sbuf.st_size; /* may cause truncation - if it does, DON'T mmap! */ + if ((tmp_size == sbuf.st_size) && + ( (this->mmap_base = mmap(NULL, tmp_size, PROT_READ, MAP_SHARED, this->fh, 0)) != (void*)-1 )) { + this->mmap_on = 1; + this->mmap_curr = this->mmap_base; + this->mmap_len = sbuf.st_size; + } else { + this->mmap_base = NULL; + } } #endif |