summaryrefslogtreecommitdiff
path: root/other
diff options
context:
space:
mode:
Diffstat (limited to 'other')
-rw-r--r--other/DHT_bootstrap.c2
-rw-r--r--other/bootstrap_daemon/src/log.c19
-rw-r--r--other/bootstrap_daemon/src/tox-bootstrapd.c2
3 files changed, 2 insertions, 21 deletions
diff --git a/other/DHT_bootstrap.c b/other/DHT_bootstrap.c
index fa71d920..e056de41 100644
--- a/other/DHT_bootstrap.c
+++ b/other/DHT_bootstrap.c
@@ -22,8 +22,6 @@
22 * 22 *
23 */ 23 */
24 24
25#define _XOPEN_SOURCE 600
26
27#ifdef HAVE_CONFIG_H 25#ifdef HAVE_CONFIG_H
28#include "config.h" 26#include "config.h"
29#endif 27#endif
diff --git a/other/bootstrap_daemon/src/log.c b/other/bootstrap_daemon/src/log.c
index ae418f93..7632d739 100644
--- a/other/bootstrap_daemon/src/log.c
+++ b/other/bootstrap_daemon/src/log.c
@@ -26,8 +26,8 @@
26 26
27#include "global.h" 27#include "global.h"
28 28
29#include <assert.h>
30#include <syslog.h> 29#include <syslog.h>
30
31#include <stdarg.h> 31#include <stdarg.h>
32#include <stdio.h> 32#include <stdio.h>
33 33
@@ -82,22 +82,7 @@ static int level_syslog(LOG_LEVEL level)
82 82
83static void log_syslog(LOG_LEVEL level, const char *format, va_list args) 83static void log_syslog(LOG_LEVEL level, const char *format, va_list args)
84{ 84{
85 va_list args2; 85 vsyslog(level_syslog(level), format, args);
86
87 va_copy(args2, args);
88 int size = vsnprintf(NULL, 0, format, args2);
89 va_end(args2);
90
91 assert(size >= 0);
92
93 if (size < 0) {
94 return;
95 }
96
97 char buf[size + 1];
98 vsnprintf(buf, size + 1, format, args);
99
100 syslog(level_syslog(level), "%s", buf);
101} 86}
102 87
103static FILE *level_stdout(LOG_LEVEL level) 88static FILE *level_stdout(LOG_LEVEL level)
diff --git a/other/bootstrap_daemon/src/tox-bootstrapd.c b/other/bootstrap_daemon/src/tox-bootstrapd.c
index a0504eee..4495f88e 100644
--- a/other/bootstrap_daemon/src/tox-bootstrapd.c
+++ b/other/bootstrap_daemon/src/tox-bootstrapd.c
@@ -22,8 +22,6 @@
22 * 22 *
23 */ 23 */
24 24
25#define _XOPEN_SOURCE 600
26
27// system provided 25// system provided
28#include <sys/stat.h> 26#include <sys/stat.h>
29#include <unistd.h> 27#include <unistd.h>