summaryrefslogtreecommitdiff
path: root/src/log_targets.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/log_targets.h')
-rw-r--r--src/log_targets.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/log_targets.h b/src/log_targets.h
index 3a12331..10d3edb 100644
--- a/src/log_targets.h
+++ b/src/log_targets.h
@@ -1,15 +1,15 @@
/*
* gcsd
*
- * gcsd the generic command sequencer daemon can be used to serialize
+ * gcsd the generic command sequencer daemon can be used to serialize
* commands sent over various paralell communication channels to a
* single command output. It can be seen as a multiplexer for any
* kind of communication between a single resource and various clients
* which want to submit commands to it or query information from it.
- * gcsd is written in C and Lua. The goal is to provide an easy to
+ * gcsd is written in C and Lua. The goal is to provide an easy to
* understand high level API based on Lua which can be used to
* implement the business logic of the so formed multiplexer daemon.
- *
+ *
*
* Copyright (C) 2009-2010 Markus Grueneis <gimpf@spreadspace.org>
* Christian Pointner <equinox@spreadspace.org>
@@ -39,7 +39,7 @@ static char* get_time_formatted()
{
char* time_string;
time_t t = time(NULL);
- if(t < 0)
+ if(t < 0)
time_string = "<time read error>";
else {
time_string = ctime(&t);
@@ -77,7 +77,7 @@ int log_target_syslog_init(log_target_t* self, const char* conf)
{
if(!self || (conf && conf[0] == 0))
return -1;
-
+
self->param_ = malloc(sizeof(log_target_syslog_param_t));
if(!self->param_)
return -2;
@@ -93,7 +93,7 @@ int log_target_syslog_init(log_target_t* self, const char* conf)
if(!len) {
free(self->param_);
return -1;
- }
+ }
logname = malloc(len+1);
if(logname) {
strncpy(logname, conf, len);
@@ -114,13 +114,13 @@ int log_target_syslog_init(log_target_t* self, const char* conf)
((log_target_syslog_param_t*)(self->param_))->facility_ = DAEMON;
return 0;
}
-
+
if(end[1] == 0 || end[1] == ',') {
free(logname);
free(self->param_);
return -1;
}
-
+
const char* start = end + 1;
end = strchr(start, ',');
int i;
@@ -155,7 +155,7 @@ void log_target_syslog_log(log_target_t* self, log_prio_t prio, const char* msg)
if(!self || !self->param_ || !self->opened_)
return;
- syslog((prio + 2) | ((log_target_syslog_param_t*)(self->param_))->facility_, "%s", msg);
+ syslog((prio + 2) | ((log_target_syslog_param_t*)(self->param_))->facility_, "%s", msg);
}
void log_target_syslog_close(log_target_t* self)
@@ -207,7 +207,7 @@ int log_target_file_init(log_target_t* self, const char* conf)
{
if(!self || (conf && conf[0] == 0))
return -1;
-
+
self->param_ = malloc(sizeof(log_target_file_param_t));
if(!self->param_)
return -2;
@@ -222,7 +222,7 @@ int log_target_file_init(log_target_t* self, const char* conf)
if(!len) {
free(self->param_);
return -1;
- }
+ }
logfilename = malloc(len+1);
if(logfilename) {
strncpy(logfilename, conf, len);