index 685ffb6cfeb77d7573156f4cec6332fc0cabdce7..fabde00747eb5130e4b33c0dbe744ed05bc64977 100644 (file)
--- a/io.c
+++ b/io.c
{
int argc;
+ argv_free(*dst);
for (argc = 0; src[argc]; argc++)
if (!argv_append(dst, src[argc]))
return FALSE;
}
bool
-io_can_read(struct io *io)
+io_can_read(struct io *io, bool can_block)
{
struct timeval tv = { 0, 500 };
fd_set fds;
FD_ZERO(&fds);
FD_SET(io->pipe, &fds);
- return select(io->pipe + 1, &fds, NULL, NULL, &tv) > 0;
+ return select(io->pipe + 1, &fds, NULL, NULL, can_block ? NULL : &tv) > 0;
}
ssize_t