aboutsummaryrefslogtreecommitdiffstats
path: root/libaxl_detach.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2020-05-10 13:44:06 +0200
committerMattias Andrée <maandree@kth.se>2020-05-10 13:44:06 +0200
commit4a968d807d2ec611f443d704ae875911894c04e2 (patch)
treea7c1d4f178842bb6971c7a4b2c159049df794dd0 /libaxl_detach.c
parentFix struct for ClientMessage event (diff)
downloadlibaxl-4a968d807d2ec611f443d704ae875911894c04e2.tar.gz
libaxl-4a968d807d2ec611f443d704ae875911894c04e2.tar.bz2
libaxl-4a968d807d2ec611f443d704ae875911894c04e2.tar.xz
A few things
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--libaxl_detach.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libaxl_detach.c b/libaxl_detach.c
new file mode 100644
index 0000000..c4a0a21
--- /dev/null
+++ b/libaxl_detach.c
@@ -0,0 +1,18 @@
+/* See LICENSE file for copyright and license details. */
+#include "common.h"
+
+int
+libaxl_detach(LIBAXL_CONNECTION *conn)
+{
+ int fd = conn->fd;
+ LIBAXL_CONTEXT *ctx;
+ while (conn->pending_out) {
+ ctx = conn->pending_out;
+ conn->pending_out = ctx->next_pending_out;
+ libaxl_context_free(ctx);
+ }
+ free(conn->in_buf);
+ free(conn->info_buf);
+ free(conn);
+ return fd;
+}