aboutsummaryrefslogtreecommitdiffstats
path: root/src/assuan-listen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/assuan-listen.c')
-rw-r--r--src/assuan-listen.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/assuan-listen.c b/src/assuan-listen.c
index 822ef32..57fe4b6 100644
--- a/src/assuan-listen.c
+++ b/src/assuan-listen.c
@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <unistd.h>
#include "assuan-defs.h"
@@ -106,3 +107,28 @@ assuan_get_output_fd (ASSUAN_CONTEXT ctx)
}
+/* Close the fd descriptor set by the command INPUT FD=n. We handle
+ this fd inside assuan so that we can do some initial checks */
+AssuanError
+assuan_close_input_fd (ASSUAN_CONTEXT ctx)
+{
+ if (!ctx || ctx->input_fd == -1)
+ return ASSUAN_Invalid_Value;
+ close (ctx->input_fd);
+ ctx->input_fd = -1;
+ return 0;
+}
+
+/* Close the fd descriptor set by the command OUTPUT FD=n. We handle
+ this fd inside assuan so that we can do some initial checks */
+AssuanError
+assuan_close_output_fd (ASSUAN_CONTEXT ctx)
+{
+ if (!ctx || ctx->output_fd == -1)
+ return ASSUAN_Invalid_Value;
+
+ close (ctx->output_fd);
+ ctx->output_fd = -1;
+ return 0;
+}
+