summaryrefslogtreecommitdiff
path: root/sysdep/unix/io.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-03-02 10:35:21 +0100
committerMaria Matejka <mq@ucw.cz>2022-03-02 12:13:49 +0100
commit48bf1322aa141ca6259b26b37551402758cff0cc (patch)
treeb900a58ac1356bf3724cfa226070ff97df3d52d5 /sysdep/unix/io.c
parent2e8b8bfcc46ec1493f9e0efe9c796b88df85ada4 (diff)
Introducing an universal temporary linpool flushed after every task
Diffstat (limited to 'sysdep/unix/io.c')
-rw-r--r--sysdep/unix/io.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c
index 4fd77453..8a116789 100644
--- a/sysdep/unix/io.c
+++ b/sysdep/unix/io.c
@@ -1854,8 +1854,8 @@ sk_read_ssh(sock *s)
/* sk_read() and sk_write() are called from BFD's event loop */
-int
-sk_read(sock *s, int revents)
+static inline int
+sk_read_noflush(sock *s, int revents)
{
switch (s->type)
{
@@ -1918,7 +1918,15 @@ sk_read(sock *s, int revents)
}
int
-sk_write(sock *s)
+sk_read(sock *s, int revents)
+{
+ int e = sk_read_noflush(s, revents);
+ tmp_flush();
+ return e;
+}
+
+static inline int
+sk_write_noflush(sock *s)
{
switch (s->type)
{
@@ -1966,6 +1974,14 @@ sk_write(sock *s)
}
}
+int
+sk_write(sock *s)
+{
+ int e = sk_write_noflush(s);
+ tmp_flush();
+ return e;
+}
+
int sk_is_ipv4(sock *s)
{ return s->af == AF_INET; }
@@ -1984,6 +2000,7 @@ sk_err(sock *s, int revents)
}
s->err_hook(s, se);
+ tmp_flush();
}
void