summaryrefslogtreecommitdiff
path: root/debug_syslog.c
diff options
context:
space:
mode:
Diffstat (limited to 'debug_syslog.c')
-rw-r--r--debug_syslog.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/debug_syslog.c b/debug_syslog.c
index c5d9dbc..c3f8062 100644
--- a/debug_syslog.c
+++ b/debug_syslog.c
@@ -27,8 +27,6 @@
*/
#include "debug_syslog.h"
-#define _GNU_SOURCE
-
#include <stdio.h>
#include <string.h>
#include <time.h>
@@ -74,7 +72,8 @@ void dbg_syslog_init(const char* host, int port)
char buf[SYSLOG_LENOFEXECNAME];
FILE* f = fopen("/proc/self/cmdline", "r");
if(f) {
- fgets(buf, SYSLOG_LENOFEXECNAME, f);
+ char* s = NULL;
+ s = fgets(buf, SYSLOG_LENOFEXECNAME, f);
fclose(f);
}
@@ -175,10 +174,6 @@ void dbg_syslog_createheader() {
*
* */
-static void _calculate_pri() {
-
-}
-
void dbg_syslog_output(char* msg)
{
if(dbg_syslog_sock < 0) return;
@@ -190,7 +185,8 @@ void dbg_syslog_output(char* msg)
strftime(buftime, SYSLOG_TIMELEN, "%b %e %H:%M:%S ", &time);
// Currently everything is mapped to local facility 4 as debug
- char bufpri[SYSLOG_PRILEN] = "<167>";
+ char bufpri[SYSLOG_PRILEN];
+ strncpy(bufpri, "<167>", SYSLOG_PRILEN);
char buftag[SYSLOG_TAGLEN];
snprintf(buftag, SYSLOG_TAGLEN, "%s[%d]: ", execname, pid);