Diff for /embedaddon/dnsmasq/src/log.c between versions 1.1.1.3 and 1.1.1.4

version 1.1.1.3, 2016/11/02 09:57:01 version 1.1.1.4, 2021/03/17 00:56:46
Line 1 Line 1
/* dnsmasq is Copyright (c) 2000-2016 Simon Kelley/* dnsmasq is Copyright (c) 2000-2021 Simon Kelley
   
    This program is free software; you can redistribute it and/or modify     This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by     it under the terms of the GNU General Public License as published by
Line 154  static void log_write(void) Line 154  static void log_write(void)
         
   while (entries)    while (entries)
     {      {
      /* The data in the payoad is written with a terminating zero character       /* The data in the payload is written with a terminating zero character 
          and the length reflects this. For a stream connection we need to            and the length reflects this. For a stream connection we need to 
          send the zero as a record terminator, but this isn't done for a            send the zero as a record terminator, but this isn't done for a 
          datagram connection, so treat the length as one less than reality            datagram connection, so treat the length as one less than reality 
Line 232  static void log_write(void) Line 232  static void log_write(void)
               logaddr.sun_len = sizeof(logaddr) - sizeof(logaddr.sun_path) + strlen(_PATH_LOG) + 1;                 logaddr.sun_len = sizeof(logaddr) - sizeof(logaddr.sun_path) + strlen(_PATH_LOG) + 1; 
 #endif  #endif
               logaddr.sun_family = AF_UNIX;                logaddr.sun_family = AF_UNIX;
              strncpy(logaddr.sun_path, _PATH_LOG, sizeof(logaddr.sun_path));              safe_strncpy(logaddr.sun_path, _PATH_LOG, sizeof(logaddr.sun_path));
                               
               /* Got connection back? try again. */                /* Got connection back? try again. */
               if (connect(log_fd, (struct sockaddr *)&logaddr, sizeof(logaddr)) != -1)                if (connect(log_fd, (struct sockaddr *)&logaddr, sizeof(logaddr)) != -1)
Line 288  void my_syslog(int priority, const char *format, ...) Line 288  void my_syslog(int priority, const char *format, ...)
     func = "-tftp";      func = "-tftp";
   else if ((LOG_FACMASK & priority) == MS_DHCP)    else if ((LOG_FACMASK & priority) == MS_DHCP)
     func = "-dhcp";      func = "-dhcp";
        else if ((LOG_FACMASK & priority) == MS_SCRIPT)
     func = "-script";
             
 #ifdef LOG_PRI  #ifdef LOG_PRI
   priority = LOG_PRI(priority);    priority = LOG_PRI(priority);
 #else  #else
Line 436  void check_log_writer(int force) Line 438  void check_log_writer(int force)
 void flush_log(void)  void flush_log(void)
 {  {
   /* write until queue empty, but don't loop forever if there's    /* write until queue empty, but don't loop forever if there's
   no connection to the syslog in existance */   no connection to the syslog in existence */
   while (log_fd != -1)    while (log_fd != -1)
     {      {
       struct timespec waiter;        struct timespec waiter;

Removed from v.1.1.1.3  
changed lines
  Added in v.1.1.1.4


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>