]> git.pld-linux.org Git - packages/pcsc-lite.git/blob - debuglog-pid.patch
up to 1.9.8
[packages/pcsc-lite.git] / debuglog-pid.patch
1 --- pcsc-lite-1.6.6/src/debuglog.c~     2010-06-30 15:40:58.000000000 +0300
2 +++ pcsc-lite-1.6.6/src/debuglog.c      2011-01-12 01:58:18.693291099 +0200
3 @@ -104,6 +104,8 @@
4  {
5         char DebugBuffer[DEBUG_BUF_SIZE];
6         va_list argptr;
7 +       // boolean not to do openlog several times
8 +       static int syslog_opened = 0;
9  
10         if ((priority < LogLevel) /* log priority lower than threshold? */
11                 || (DEBUGLOG_NO_DEBUG == LogMsgType))
12 @@ -114,13 +116,18 @@
13         vsnprintf(DebugBuffer, sizeof DebugBuffer, fmt, argptr);
14         va_end(argptr);
15  
16 +       if (DEBUGLOG_SYSLOG_DEBUG == LogMsgType && !syslog_opened) {
17 +               openlog(NULL, LOG_PID, LOG_DAEMON);
18 +               syslog_opened = 1;
19 +       }
20 +
21         log_line(priority, DebugBuffer);
22  } /* log_msg */
23  
24  static void log_line(const int priority, const char *DebugBuffer)
25  {
26         if (DEBUGLOG_SYSLOG_DEBUG == LogMsgType)
27 -               syslog(LOG_INFO, "%s", DebugBuffer);
28 +               syslog(LOG_DEBUG, "%s", DebugBuffer);
29         else
30         {
31                 static struct timeval last_time = { 0, 0 };
This page took 0.068574 seconds and 3 git commands to generate.