[INTERPRETER]

* BUG: Do not read ahead a ready to read file descriptor if we are in 
  direct mode and if the file is a not a regular file.


git-svn-id: svn://localhost/gambas/trunk@6994 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2015-03-19 23:23:47 +00:00
parent 0fbfdf5757
commit 3de004cff2
3 changed files with 7 additions and 2 deletions

View file

@ -597,6 +597,9 @@ static void fill_buffer(STREAM *stream, char *addr, bool do_not_wait_ready)
bool STREAM_read_ahead(STREAM *stream)
{
if (stream->common.no_read_ahead)
return FALSE;
if (stream->common.buffer && stream->common.buffer_pos < stream->common.buffer_len)
return FALSE;

View file

@ -58,10 +58,11 @@ typedef
unsigned standard : 1;
unsigned blocking : 1;
unsigned redirected : 1;
unsigned no_read_ahead : 1;
#if DEBUG_STREAM
unsigned tag : 6;
unsigned tag : 5;
#else
unsigned _reserved : 6;
unsigned _reserved : 5;
#endif
short buffer_pos;
short buffer_len;

View file

@ -111,6 +111,7 @@ static int stream_open(STREAM *stream, const char *path, int mode)
if (!S_ISREG(info.st_mode))
{
stream->common.available_now = FALSE;
stream->common.no_read_ahead = TRUE;
fcntl(fd, F_SETFL, O_NONBLOCK);
}
else