summaryrefslogtreecommitdiff
path: root/src/libunixonacid
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2015-01-04 19:00:46 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2015-01-04 19:00:46 +0000
commit5b4cf1798bfaf7be1dfaea36614757db80cae23d (patch)
tree3ab634ccb9bfe4de6c50be8c0f1cef48d2d53914 /src/libunixonacid
parentd76cbe1a8d6ae1e839bd7613f3291da2c9b042d0 (diff)
downloadskalibs-5b4cf1798bfaf7be1dfaea36614757db80cae23d.tar.xz
Add unixmessage_drop and some stuff in skaclient
Diffstat (limited to 'src/libunixonacid')
-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 ;
+}