Commit e58ae413 e58ae41328ab2134cc888355596c985bd7345986 by Alain Magloire

Bugfix in stream.c (stream_wait) should return true if we have something in the cache.

1 parent 8f6a087a
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2004 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......
......@@ -774,6 +774,18 @@ stream_wait (stream_t stream, int *pflags, struct timeval *tvp)
{
if (stream == NULL)
return EINVAL;
/* Take to acount if we have any buffering. */
if ((*pflags) & MU_STREAM_READY_RD)
{
if (stream->rbuffer.count > 0)
{
*pflags = 0;
*pflags |= MU_STREAM_READY_RD;
return 0;
}
}
if (stream->_wait)
return stream->_wait (stream, pflags, tvp);
return ENOSYS;
......