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
02e2dd1a
...
02e2dd1ab23ef3e50512fcb7c5d889132ca672e0
authored
2003-01-28 21:44:46 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(util_wait_input): New function.
1 parent
3b3e96af
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
imap4d/util.c
imap4d/util.c
View file @
02e2dd1
...
...
@@ -1125,6 +1125,39 @@ util_set_output (stream_t str)
ostream
=
str
;
}
/* Wait TIMEOUT seconds for data on the input stream.
Returns 0 if no data available
1 if some data is available
-1 an error occurred */
int
util_wait_input
(
int
timeout
)
{
int
rc
,
fd
;
fd_set
rdset
;
if
(
stream_get_fd
(
istream
,
&
fd
))
{
errno
=
ENOSYS
;
return
-
1
;
}
FD_ZERO
(
&
rdset
);
FD_SET
(
fd
,
&
rdset
);
do
{
struct
timeval
tv
;
tv
.
tv_sec
=
timeout
;
tv
.
tv_usec
=
0
;
rc
=
select
(
fd
+
1
,
&
rdset
,
NULL
,
NULL
,
&
tv
);
}
while
(
rc
==
-
1
&&
errno
==
EINTR
);
return
rc
;
}
void
util_flush_output
()
{
...
...
Please
register
or
sign in
to post a comment