summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2014-12-05 16:21:01 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2014-12-05 16:21:01 +0000
commit89cd43338a2a9bb768d715f1bb53987801be7c79 (patch)
tree67b9fb3413e741c5b8ba8b6b10494be25310b5e4
parent51cf178616eebbb76e595d6abe0ffdaa83d2aec5 (diff)
downloadskalibs-89cd43338a2a9bb768d715f1bb53987801be7c79.tar.xz
Bugfix: skaclient_start and skaclient_startf need a flush before a receive!
-rw-r--r--src/libunixonacid/skaclient_start.c7
-rw-r--r--src/libunixonacid/skaclient_startf.c7
2 files changed, 14 insertions, 0 deletions
diff --git a/src/libunixonacid/skaclient_start.c b/src/libunixonacid/skaclient_start.c
index b17750b..a7e3e67 100644
--- a/src/libunixonacid/skaclient_start.c
+++ b/src/libunixonacid/skaclient_start.c
@@ -30,6 +30,13 @@ int skaclient_start (
unixmessage_t m ;
register int r ;
if (!skaclient_start_async(a, bufss, bufsn, auxbufss, auxbufsn, bufas, bufan, auxbufas, auxbufan, q, qlen, path, before, beforelen, after, afterlen, &blah)) return 0 ;
+ if (!skaclient_timed_flush(a, deadline, stamp))
+ {
+ register int e = errno ;
+ skaclient_end(a) ;
+ errno = e ;
+ return 0 ;
+ }
r = unixmessage_timed_receive(&a->syncin, &m, deadline, stamp) ;
if (r < 1)
{
diff --git a/src/libunixonacid/skaclient_startf.c b/src/libunixonacid/skaclient_startf.c
index aa36323..57d6f46 100644
--- a/src/libunixonacid/skaclient_startf.c
+++ b/src/libunixonacid/skaclient_startf.c
@@ -33,6 +33,13 @@ int skaclient_startf (
unixmessage_t m ;
register int r ;
if (!skaclient_startf_async(a, bufss, bufsn, auxbufss, auxbufsn, bufas, bufan, auxbufas, auxbufan, q, qlen, prog, argv, envp, options, before, beforelen, after, afterlen, &blah)) return 0 ;
+ if (!skaclient_timed_flush(a, deadline, stamp))
+ {
+ register int e = errno ;
+ skaclient_end(a) ;
+ errno = e ;
+ return 0 ;
+ }
r = unixmessage_timed_receive(&a->syncin, &m, deadline, stamp) ;
if (r < 1)
{