projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Sprinkling the source with static and attributes.
[tinc]
/
src
/
logger.c
diff --git
a/src/logger.c
b/src/logger.c
index
de66227
..
8029565
100644
(file)
--- a/
src/logger.c
+++ b/
src/logger.c
@@
-17,12
+17,13
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: logger.c,v 1.1.2.
1 2003/07/06 22:11:31
guus Exp $
+ $Id: logger.c,v 1.1.2.
2 2003/07/06 23:16:28
guus Exp $
*/
#include <stdio.h>
#include <stdarg.h>
#include <syslog.h>
*/
#include <stdio.h>
#include <stdarg.h>
#include <syslog.h>
+#include <unistd.h>
#include "conf.h"
#include "logger.h"
#include "conf.h"
#include "logger.h"
@@
-30,15
+31,13
@@
#include "system.h"
volatile int debug_level = DEBUG_NOTHING;
#include "system.h"
volatile int debug_level = DEBUG_NOTHING;
-int logmode = LOGMODE_STDERR;
-pid_t logpid;
+
static
int logmode = LOGMODE_STDERR;
+
static
pid_t logpid;
extern char *logfilename;
extern char *logfilename;
-FILE *logfile = NULL;
-const char *logident = NULL;
+
static
FILE *logfile = NULL;
+
static
const char *logident = NULL;
void openlogger(const char *ident, int mode) {
void openlogger(const char *ident, int mode) {
- char *fname;
-
logident = ident;
logmode = mode;
logident = ident;
logmode = mode;
@@
-65,7
+64,7
@@
void vlogger(int priority, const char *format, va_list ap) {
fprintf(stderr, "\n");
break;
case LOGMODE_FILE:
fprintf(stderr, "\n");
break;
case LOGMODE_FILE:
- fprintf(logfile, "%d %s[%d]: ", time(NULL), logident, logpid);
+ fprintf(logfile, "%
l
d %s[%d]: ", time(NULL), logident, logpid);
vfprintf(logfile, format, ap);
fprintf(logfile, "\n");
break;
vfprintf(logfile, format, ap);
fprintf(logfile, "\n");
break;