File: vsyslog.c

package info (click to toggle)
httptunnel 3.3%2Bdfsg-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 524 kB
  • ctags: 309
  • sloc: ansic: 4,646; sh: 338; makefile: 97
file content (38 lines) | stat: -rw-r--r-- 725 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
port/vsyslog.c

Copyright (C) 1999 Lars Brinkhoff.  See COPYING for terms and conditions.
*/

#include <stdio_.h>
#include <syslog_.h>
#include <stdarg.h>

#include "config.h"

#ifndef HAVE_SYSLOG
void
syslog (int level, const char *fmt0, ...)
{
#ifdef HAVE_VSYSLOG
  va_list ap;
  va_start (ap, fmt0);
  vsyslog (level, fmt0, ap);
  va_end (ap);
#else
  /* This system has neither syslog() nor vsyslog(), so do nothing. */
  /* FIXME: this function could open a file and log messages in it. */
#endif
}
#endif

#ifndef HAVE_VSYSLOG
void
vsyslog (int level, const char *fmt0, va_list ap)
{
  char buffer[512];

  if (vsnprintf (buffer, sizeof buffer, fmt0, ap) > 0)
    syslog (level, buffer);
}
#endif /* HAVE_VSYSLOG */