summaryrefslogtreecommitdiff
path: root/src/libunixonacid/textclient_end.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libunixonacid/textclient_end.c')
-rw-r--r--src/libunixonacid/textclient_end.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libunixonacid/textclient_end.c b/src/libunixonacid/textclient_end.c
index 58fc930..1ddf93f 100644
--- a/src/libunixonacid/textclient_end.c
+++ b/src/libunixonacid/textclient_end.c
@@ -1,5 +1,6 @@
/* ISC license. */
+#include <errno.h>
#include <skalibs/djbunix.h>
#include <skalibs/textmessage.h>
#include <skalibs/textclient.h>
@@ -15,8 +16,10 @@ void textclient_end (textclient_t *a)
textmessage_receiver_free(&a->asyncin) ;
if (a->pid && a->options & TEXTCLIENT_OPTION_WAITPID)
{
+ int e = errno ;
int wstat ;
waitpid_nointr(a->pid, &wstat, 0) ;
+ errno = e ;
}
*a = textclient_zero ;
}