summaryrefslogtreecommitdiff
path: root/src/libunixonacid/skaclient_end.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libunixonacid/skaclient_end.c')
-rw-r--r--src/libunixonacid/skaclient_end.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/libunixonacid/skaclient_end.c b/src/libunixonacid/skaclient_end.c
new file mode 100644
index 0000000..23dafab
--- /dev/null
+++ b/src/libunixonacid/skaclient_end.c
@@ -0,0 +1,21 @@
+/* ISC license. */
+
+#include <skalibs/djbunix.h>
+#include <skalibs/skaclient.h>
+#include <skalibs/unixmessage.h>
+
+void skaclient_end (skaclient_t *a)
+{
+ fd_close(a->syncout.fd) ;
+ fd_close(a->asyncout.fd) ;
+ unixmessage_sender_free(&a->syncout) ;
+ unixmessage_sender_free(&a->asyncout) ;
+ unixmessage_receiver_free(&a->syncin) ;
+ unixmessage_receiver_free(&a->asyncin) ;
+ if (a->pid && a->options & SKACLIENT_OPTION_WAITPID)
+ {
+ int wstat ;
+ waitpid_nointr(a->pid, &wstat, 0) ;
+ }
+ *a = skaclient_zero ;
+}