summaryrefslogtreecommitdiff
path: root/src/libunixonacid/unixmessage_drop.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libunixonacid/unixmessage_drop.c')
-rw-r--r--src/libunixonacid/unixmessage_drop.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libunixonacid/unixmessage_drop.c b/src/libunixonacid/unixmessage_drop.c
new file mode 100644
index 0000000..7fa34fb
--- /dev/null
+++ b/src/libunixonacid/unixmessage_drop.c
@@ -0,0 +1,13 @@
+/* ISC license. */
+
+#include <errno.h>
+#include <skalibs/djbunix.h>
+#include <skalibs/unixmessage.h>
+
+void unixmessage_drop (unixmessage_t const *m)
+{
+ int e = errno ;
+ register unsigned int i = 0 ;
+ for (; i < m->nfds ; i++) fd_close(m->fds[i]) ;
+ errno = e ;
+}