Diff

Differences From Artifact [33946c2e20]:

To Artifact [932c017b84]:


   583    583   	pthread_create(&thread_id, NULL, filed_logging_thread, args);
   584    584   
   585    585   	filed_log_msg("START");
   586    586   
   587    587   	return(0);
   588    588   }
   589    589   #endif
          590  +
          591  +static void *filed_sockettimeout_thread(void *arg) {
          592  +	while (1) {
          593  +		usleep(300000);
          594  +	}
          595  +
          596  +	return(NULL);
          597  +
          598  +	/* NOTREACHED */
          599  +	arg = arg;
          600  +}
          601  +
          602  +static int filed_sockettimeout_thread_init(void) {
          603  +	pthread_t thread_id;
          604  +
          605  +	pthread_create(&thread_id, NULL, filed_sockettimeout_thread, NULL);
          606  +
          607  +	return(0);
          608  +}
   590    609   
   591    610   /* Format time per RFC2616 */
   592    611   static char *filed_format_time(char *buffer, size_t buffer_len, const time_t timeinfo) {
   593    612   	struct tm timeinfo_tm, *timeinfo_tm_p;
   594    613   
   595    614   	timeinfo_tm_p = gmtime_r(&timeinfo, &timeinfo_tm);
   596    615   	if (timeinfo_tm_p == NULL) {
................................................................................
  1605   1624   	/* Create logging thread */
  1606   1625   	init_ret = filed_logging_thread_init(log_fp);
  1607   1626   	if (init_ret != 0) {
  1608   1627   		perror("filed_logging_thread_init");
  1609   1628   
  1610   1629   		return(4);
  1611   1630   	}
         1631  +
         1632  +	/* Create socket termination thread */
         1633  +	init_ret = filed_sockettimeout_thread_init();
         1634  +	if (init_ret != 0) {
         1635  +		perror("filed_sockettimeout_thread_init");
         1636  +
         1637  +		return(6);
         1638  +	}
  1612   1639   
  1613   1640   	/* Create worker threads */
  1614   1641   	init_ret = filed_worker_threads_init(fd, thread_count, &thread_options);
  1615   1642   	if (init_ret != 0) {
  1616   1643   		perror("filed_worker_threads_init");
  1617   1644   
  1618   1645   		return(5);