summaryrefslogtreecommitdiffstats
path: root/usr/klibc/closelog.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--usr/klibc/closelog.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/usr/klibc/closelog.c b/usr/klibc/closelog.c
new file mode 100644
index 0000000..0437710
--- /dev/null
+++ b/usr/klibc/closelog.c
@@ -0,0 +1,18 @@
+/*
+ * closelog.c
+ */
+
+#include <syslog.h>
+#include <unistd.h>
+
+extern int __syslog_fd;
+
+void closelog(void)
+{
+ int logfd = __syslog_fd;
+
+ if (logfd != -1) {
+ close(logfd);
+ __syslog_fd = -1;
+ }
+}