summaryrefslogtreecommitdiff
path: root/common/spio.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/spio.c')
-rw-r--r--common/spio.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/common/spio.c b/common/spio.c
index 67d32b1..4075e9a 100644
--- a/common/spio.c
+++ b/common/spio.c
@@ -245,6 +245,9 @@ unsigned int spio_select(spctx_t* ctx, ...)
if(i > (sizeof(int) * 8) - 2)
break;
+ /* We have data on the descriptor, which is an action */
+ io->last_action = time(NULL);
+
/* Check if the buffer has something in it */
if(FD_ISSET(io->fd, &mask))
ret |= (1 << i);
@@ -363,6 +366,9 @@ int read_raw(spctx_t* ctx, spio_t* io, int opts)
return count;
}
+ /* Read data which is a descriptor action */
+ io->last_action = time(NULL);
+
/* Check for a new line */
p = (char*)memchr(at, '\n', x);
if(p != NULL)
@@ -489,6 +495,8 @@ int spio_write_data_raw(spctx_t* ctx, spio_t* io, unsigned char* buf, int len)
if(io->fd == -1)
return 0;
+ io->last_action = time(NULL);
+
while(len > 0)
{
r = write(io->fd, buf, len);
@@ -556,6 +564,8 @@ void spio_read_junk(spctx_t* ctx, spio_t* io)
if(l <= 0)
break;
+ io->last_action = time(NULL);
+
buf[l] = 0;
t = trim_start(buf);