Ticket #563: 0001-fix-management-hold.patch

File 0001-fix-management-hold.patch, 1.4 KB (added by kristov, 9 years ago)

fixes management-hold

  • src/openvpn/init.c

    diff -urN openvpn-2.3.7.orig/src/openvpn/init.c openvpn-2.3.7.new/src/openvpn/init.c
    old new  
    18251825 * Possible hold on initialization
    18261826 */
    18271827static bool
    1828 do_hold (void)
     1828do_hold (struct context *c)
    18291829{
    18301830#ifdef ENABLE_MANAGEMENT
    18311831  if (management)
    18321832    {
     1833      /* if c is defined, daemonize before hold */
     1834      if (c && c->options.daemon && management_should_daemonize (management))
     1835        do_init_first_time (c);
     1836
    18331837      /* block until management hold is released */
    18341838      if (management_hold (management))
    18351839        return true;
     
    18951899  c->persist.restart_sleep_seconds = 0;
    18961900
    18971901  /* do managment hold on context restart, i.e. second, third, fourth, etc. initialization */
    1898   if (do_hold ())
     1902  if (do_hold (NULL))
    18991903    sec = 0;
    19001904
    19011905  if (sec)
     
    19141918  if (!c->first_time)
    19151919    socket_restart_pause (c);
    19161920  else
    1917     do_hold (); /* do management hold on first context initialization */
     1921    do_hold (NULL); /* do management hold on first context initialization */
    19181922}
    19191923
    19201924/*
     
    32213225            }
    32223226
    32233227          /* initial management hold, called early, before first context initialization */
    3224           do_hold ();
     3228          do_hold (c);
    32253229          if (IS_SIG (c))
    32263230            {
    32273231              msg (M_WARN, "Signal received from management interface, exiting");