Check-in [b4740ac3ab]
Overview
Comment:Fixed compilation issues with no logging mode
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:b4740ac3ab88061cb5814de8ab90ded5f6feb0c9
User & Date: rkeene on 2015-07-29 14:28:17
Other Links: manifest | tags
Context
2015-07-29
14:29
Added an ifdef for exposing an AFL-compatible testing mode check-in: f505311236 user: rkeene tags: trunk
14:28
Fixed compilation issues with no logging mode check-in: b4740ac3ab user: rkeene tags: trunk
2014-12-29
04:39
Updated to be more aggressive in encoding wiki characters in man pages check-in: 74424b0987 user: rkeene tags: trunk
Changes

Modified filed.c from [974bab36c9] to [5f2e24471a].

   263    263   	struct sockaddr_in addr_v4;
   264    264   	struct sockaddr *addr;
   265    265   	socklen_t addr_len;
   266    266   	int pton_ret, bind_ret, listen_ret;
   267    267   	int family;
   268    268   	int fd;
   269    269   
   270         -
   271    270   	family = AF_INET6;
   272    271   	pton_ret = inet_pton(family, address, &addr_v6.sin6_addr.s6_addr);
   273    272   	if (pton_ret != 1) {
   274    273   		family = AF_INET;
   275    274   		pton_ret = inet_pton(family, address, &addr_v4.sin_addr.s_addr);
   276    275   		if (pton_ret != 1) {
   277    276   			return(-1);
................................................................................
   318    317   #ifdef FILED_DONT_LOG
   319    318   #  define filed_logging_thread_init(x) 0
   320    319   #  define filed_log_msg_debug(x, ...) /**/
   321    320   #  define filed_log_msg(x, ...) /**/
   322    321   #  define filed_log_entry(x) /**/
   323    322   #  define filed_log_ip(x, ...) NULL
   324    323   #  define filed_log_new(x) &local_dummy_log
   325         -#  define filed_log_open(x) stdout
          324  +#  define filed_log_free(x) /**/
          325  +
          326  +/* Return logging handle */
          327  +static FILE *filed_log_open(const char *file) {
          328  +	return(stdout);
          329  +	file = file;
          330  +}
   326    331   #else
          332  +#  define filed_log_free(x) free(x)
   327    333   #  ifdef FILED_DEBUG
   328    334   #    define filed_log_msg_debug(x, ...) { fprintf(stderr, x, __VA_ARGS__); fprintf(stderr, "\n"); fflush(stderr); }
   329    335   #  else
   330    336   #    define filed_log_msg_debug(x, ...) /**/
   331    337   #  endif
   332    338   
   333    339   /* Initialize logging thread */
................................................................................
  1159   1165   		 */
  1160   1166   		if (fd < 0) {
  1161   1167   			/* Log the new connection */
  1162   1168   			filed_log_msg("ACCEPT_FAILED");
  1163   1169   
  1164   1170   			failure_count++;
  1165   1171   
  1166         -			free(log);
         1172  +			filed_log_free(log);
  1167   1173   
  1168   1174   			continue;
  1169   1175   		}
  1170   1176   
  1171   1177   		/* Fill in log structure */
  1172   1178   		if (filed_log_ip((struct sockaddr *) &addr, log->ip, sizeof(log->ip)) == NULL) {
  1173   1179   			log->ip[0] = '\0';