/[inetutils]/inetutils/syslogd/syslogd.c
ViewVC logotype

Diff of /inetutils/syslogd/syslogd.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.67 by gray, Mon Sep 30 13:55:11 2002 UTC revision 1.68 by gray, Wed May 21 14:50:57 2003 UTC
# Line 557  main (int argc, char *argv[]) Line 557  main (int argc, char *argv[])
557        exit (2);        exit (2);
558      }      }
559    
560      /* read configuration file */
561      init (0);
562    
563  #ifdef PATH_KLOG  #ifdef PATH_KLOG
564    /* Initialize kernel logging and add to the list.  */    /* Initialize kernel logging and add to the list.  */
565    if (!NoKLog)    if (!NoKLog)
# Line 608  main (int argc, char *argv[]) Line 611  main (int argc, char *argv[])
611          dbg_printf ("Can't open UDP port: %s\n", strerror (errno));          dbg_printf ("Can't open UDP port: %s\n", strerror (errno));
612      }      }
613    
   /* read configuration file */  
   init (0);  
   
614    /* Tuck my process id away.  */    /* Tuck my process id away.  */
615    fp = fopen (PidFile, "w");    fp = fopen (PidFile, "w");
616    if (fp != NULL)    if (fp != NULL)
# Line 1119  logmsg (int pri, const char *msg, const Line 1119  logmsg (int pri, const char *msg, const
1119    for (f = Files; f; f = f->f_next)    for (f = Files; f; f = f->f_next)
1120      {      {
1121        /* Skip messages that are incorrect priority. */        /* Skip messages that are incorrect priority. */
1122        if (!(f->f_pmask[fac] & LOG_MASK (prilev)) ||        if (!(f->f_pmask[fac] & LOG_MASK (prilev)))
           f->f_pmask[fac] == INTERNAL_NOPRI)  
1123          continue;          continue;
1124    
1125        if (f->f_type == F_CONSOLE && (flags & IGN_CONS))        if (f->f_type == F_CONSOLE && (flags & IGN_CONS))
# Line 1762  init (int signo) Line 1761  init (int signo)
1761          {          {
1762            int i;            int i;
1763            for (i = 0; i <= LOG_NFACILITIES; i++)            for (i = 0; i <= LOG_NFACILITIES; i++)
1764              if (f->f_pmask[i] == INTERNAL_NOPRI)              if (f->f_pmask[i] == 0)
1765                dbg_printf(" X ");                dbg_printf(" X ");
1766              else              else
1767                dbg_printf("%2x ", f->f_pmask[i]);                dbg_printf("%2x ", f->f_pmask[i]);
# Line 1820  cfline (const char *line, struct filed * Line 1819  cfline (const char *line, struct filed *
1819    memset (f, 0, sizeof (*f));    memset (f, 0, sizeof (*f));
1820    for (i = 0; i <= LOG_NFACILITIES; i++)    for (i = 0; i <= LOG_NFACILITIES; i++)
1821      {      {
1822        f->f_pmask[i] = INTERNAL_NOPRI;        f->f_pmask[i] = 0;
1823        f->f_flags = 0;        f->f_flags = 0;
1824      }      }
1825    
# Line 1850  cfline (const char *line, struct filed * Line 1849  cfline (const char *line, struct filed *
1849            case '!':            case '!':
1850              negate_pri = 1;              negate_pri = 1;
1851              break;              break;
1852                
1853            case '=':            case '=':
1854              excl_pri = 1;              excl_pri = 1;
1855              break;              break;
# Line 1858  cfline (const char *line, struct filed * Line 1858  cfline (const char *line, struct filed *
1858        /* Decode priority name and set up bit masks.  */        /* Decode priority name and set up bit masks.  */
1859        if (*bp == '*')        if (*bp == '*')
1860          {          {
1861            pri_clear = INTERNAL_NOPRI;            pri_clear = 0;
1862            pri_set = LOG_UPTO (LOG_PRIMASK);            pri_set = LOG_UPTO (LOG_PRIMASK);
1863          }          }
1864        else        else
# Line 1871  cfline (const char *line, struct filed * Line 1871  cfline (const char *line, struct filed *
1871                logerror (ebuf);                logerror (ebuf);
1872                return;                return;
1873              }              }
1874            pri_clear = 0;            if (pri == INTERNAL_NOPRI)
1875            pri_set = excl_pri ? LOG_MASK (pri) : LOG_UPTO (pri);              {
1876                  pri_clear = 255;
1877                  pri_set = 0;
1878                }
1879              else
1880                {
1881                  pri_clear = 0;
1882                  pri_set = excl_pri ? LOG_MASK (pri) : LOG_UPTO (pri);
1883                }
1884          }          }
1885        if (negate_pri)        if (negate_pri)
1886          {          {
# Line 1895  cfline (const char *line, struct filed * Line 1903  cfline (const char *line, struct filed *
1903                   */                   */
1904                  if (buf[1] == '*' && ((1 << i) & facilities_seen))                  if (buf[1] == '*' && ((1 << i) & facilities_seen))
1905                    continue;                    continue;
1906                    
1907                  f->f_pmask[i] &= ~pri_clear;                  f->f_pmask[i] &= ~pri_clear;
1908                  f->f_pmask[i] |= pri_set;                  f->f_pmask[i] |= pri_set;
1909                }                }
# Line 1910  cfline (const char *line, struct filed * Line 1919  cfline (const char *line, struct filed *
1919                    logerror (ebuf);                    logerror (ebuf);
1920                    return;                    return;
1921                  }                  }
1922    
1923                f->f_pmask[LOG_FAC(i)] &= ~pri_clear;                f->f_pmask[LOG_FAC(i)] &= ~pri_clear;
1924                f->f_pmask[LOG_FAC(i)] |= pri_set;                f->f_pmask[LOG_FAC(i)] |= pri_set;
1925              }              }

Legend:
Removed from v.1.67  
changed lines
  Added in v.1.68

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26