Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
e58ae413
...
e58ae41328ab2134cc888355596c985bd7345986
authored
2004-07-05 05:07:06 +0000
by
Alain Magloire
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Bugfix in stream.c (stream_wait) should return true if we have something in the cache.
1 parent
8f6a087a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
10 deletions
mailbox/include/registrar0.h
mailbox/stream.c
mailbox/include/registrar0.h
View file @
e58ae41
/* 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
...
...
@@ -81,7 +81,7 @@ extern int _mailbox_mh_init __P((mailbox_t mailbox));
#define MU_MAILDIR_SCHEME "maildir:"
#define MU_MAILDIR_SCHEME_LEN (sizeof (MU_MAILDIR_SCHEME) - 1)
extern
int
_mailbox_maildir_init
__P
((
mailbox_t
mailbox
));
#ifdef __cplusplus
}
#endif
...
...
mailbox/stream.c
View file @
e58ae41
...
...
@@ -80,7 +80,7 @@ stream_destroy (stream_t *pstream, void *owner)
if
(
stream
->
rbuffer
.
base
)
free
(
stream
->
rbuffer
.
base
);
if
(
stream
->
_destroy
)
if
(
stream
->
_destroy
)
stream
->
_destroy
(
stream
);
free
(
stream
);
...
...
@@ -114,7 +114,7 @@ stream_close (stream_t stream)
return
EINVAL
;
if
(
stream
->
state
==
MU_STREAM_STATE_CLOSE
)
return
0
;
stream
->
state
=
MU_STREAM_STATE_CLOSE
;
/* Clear the buffer of any residue left. */
if
(
stream
->
rbuffer
.
base
)
...
...
@@ -740,31 +740,31 @@ stream_seek (stream_t stream, off_t off, int whence)
off_t
size
=
0
;
size_t
pos
;
int
rc
;
if
((
rc
=
stream_size
(
stream
,
&
size
)))
return
rc
;
switch
(
whence
)
{
case
SEEK_SET
:
pos
=
off
;
break
;
case
SEEK_CUR
:
pos
=
off
+
stream
->
offset
;
break
;
case
SEEK_END
:
pos
=
size
+
off
;
break
;
default:
return
EINVAL
;
}
if
(
pos
>
size
)
return
EIO
;
stream
->
offset
=
pos
;
return
0
;
}
...
...
@@ -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
;
...
...
Please
register
or
sign in
to post a comment