aboutsummaryrefslogtreecommitdiffstats
path: root/assuan/assuan-listen.c
diff options
context:
space:
mode:
authorMarcus Brinkmann <[email protected]>2001-12-19 00:23:25 +0000
committerMarcus Brinkmann <[email protected]>2001-12-19 00:23:25 +0000
commit102009c336bc526270092aad9abb72e136c7df6a (patch)
tree38a2512684ee10e884e1cfaacad6707f2a9986bc /assuan/assuan-listen.c
parentFinal polish. (diff)
downloadgpgme-102009c336bc526270092aad9abb72e136c7df6a.tar.gz
gpgme-102009c336bc526270092aad9abb72e136c7df6a.zip
Update from newpg.
Diffstat (limited to 'assuan/assuan-listen.c')
-rw-r--r--assuan/assuan-listen.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/assuan/assuan-listen.c b/assuan/assuan-listen.c
index 822ef32c..57fe4b66 100644
--- a/assuan/assuan-listen.c
+++ b/assuan/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;
+}
+