Example #1
0
void
openvpn_exit (const int status)
{
#ifdef ENABLE_PLUGIN
  void plugin_abort (void);
#endif

#ifdef WIN32
  uninit_win32 ();
#endif

  close_syslog ();

#ifdef ENABLE_PLUGIN
  plugin_abort ();
#endif

#if PORT_SHARE
  if (port_share)
    port_share_abort (port_share);
#endif

#ifdef ABORT_ON_ERROR
  if (status == OPENVPN_EXIT_STATUS_ERROR)
    abort ();
#endif

  if (status == OPENVPN_EXIT_STATUS_GOOD)
    perf_output_results ();

  exit (status);
}
Example #2
0
void close_logfile(void)
{
	if (log_fd > 0) {
		close(log_fd);
		log_fd = 0;
	}
	close_syslog();
}
Example #3
0
void
openvpn_exit (const int status)
{
  if (!forked)
    {
      void tun_abort();
#ifdef ENABLE_PLUGIN
      void plugin_abort (void);
#endif

      tun_abort();

#ifdef WIN32
      uninit_win32 ();
#endif

      close_syslog ();

#ifdef ENABLE_PLUGIN
      plugin_abort ();
#endif

#if PORT_SHARE
      if (port_share)
	port_share_abort (port_share);
#endif

#ifdef ENABLE_MEMSTATS
      mstats_close();
#endif

#ifdef ABORT_ON_ERROR
      if (status == OPENVPN_EXIT_STATUS_ERROR)
	abort ();
#endif

      if (status == OPENVPN_EXIT_STATUS_GOOD)
	perf_output_results ();

	//Sam.B	2013/10/31
      if(status)
	update_nvram_status(EXIT_ERROR);
      else
	update_nvram_status(EXIT_GOOD);
	//Sam.E	2013/10/31
    }

  exit (status);
}