]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/vty.c
Revert "lib: Fix handling of poll"
[mirror_frr.git] / lib / vty.c
index d7607881b21f84e7b1261b07b6e468b3639847ff..ae3e595364edae9b68ecd1f5ce52cfda46ac336e 100644 (file)
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -701,7 +701,6 @@ vty_end_config (struct vty *vty)
     case ZEBRA_NODE:
     case RIP_NODE:
     case RIPNG_NODE:
-    case BABEL_NODE:
     case BGP_NODE:
     case BGP_VPNV4_NODE:
     case BGP_IPV4_NODE:
@@ -1110,7 +1109,6 @@ vty_stop_input (struct vty *vty)
     case ZEBRA_NODE:
     case RIP_NODE:
     case RIPNG_NODE:
-    case BABEL_NODE:
     case BGP_NODE:
     case RMAP_NODE:
     case OSPF_NODE:
@@ -2415,7 +2413,7 @@ vty_read_config (char *config_file,
         {
           ret = stat (integrate_default, &conf_stat);
           if (ret >= 0)
-           return;
+           goto tmp_free_and_out;
         }
 #endif /* VTYSH */
       confp = fopen (config_default_dir, "r");
@@ -2433,8 +2431,8 @@ vty_read_config (char *config_file,
           else
             {
               fprintf (stderr, "can't open configuration file [%s]\n",
-                                config_default_dir);
-                 exit (1);
+                      config_default_dir);
+             goto tmp_free_and_out;
             }
         }      
       else
@@ -2446,7 +2444,8 @@ vty_read_config (char *config_file,
   fclose (confp);
 
   host_config_set (fullpath);
-  
+
+tmp_free_and_out:
   if (tmp)
     XFREE (MTYPE_TMP, fullpath);
 }
@@ -2527,7 +2526,7 @@ vty_config_unlock (struct vty *vty)
 }
 
 /* Master of the threads. */
-static struct thread_master *master;
+static struct thread_master *vty_master;
 
 static void
 vty_event (enum event event, int sock, struct vty *vty)
@@ -2537,23 +2536,23 @@ vty_event (enum event event, int sock, struct vty *vty)
   switch (event)
     {
     case VTY_SERV:
-      vty_serv_thread = thread_add_read (master, vty_accept, vty, sock);
+      vty_serv_thread = thread_add_read (vty_master, vty_accept, vty, sock);
       vector_set_index (Vvty_serv_thread, sock, vty_serv_thread);
       break;
 #ifdef VTYSH
     case VTYSH_SERV:
-      vty_serv_thread = thread_add_read (master, vtysh_accept, vty, sock);
+      vty_serv_thread = thread_add_read (vty_master, vtysh_accept, vty, sock);
       vector_set_index (Vvty_serv_thread, sock, vty_serv_thread);
       break;
     case VTYSH_READ:
-      vty->t_read = thread_add_read (master, vtysh_read, vty, sock);
+      vty->t_read = thread_add_read (vty_master, vtysh_read, vty, sock);
       break;
     case VTYSH_WRITE:
-      vty->t_write = thread_add_write (master, vtysh_write, vty, sock);
+      vty->t_write = thread_add_write (vty_master, vtysh_write, vty, sock);
       break;
 #endif /* VTYSH */
     case VTY_READ:
-      vty->t_read = thread_add_read (master, vty_read, vty, sock);
+      vty->t_read = thread_add_read (vty_master, vty_read, vty, sock);
 
       /* Time out treatment. */
       if (vty->v_timeout)
@@ -2561,12 +2560,12 @@ vty_event (enum event event, int sock, struct vty *vty)
          if (vty->t_timeout)
            thread_cancel (vty->t_timeout);
          vty->t_timeout = 
-           thread_add_timer (master, vty_timeout, vty, vty->v_timeout);
+           thread_add_timer (vty_master, vty_timeout, vty, vty->v_timeout);
        }
       break;
     case VTY_WRITE:
       if (! vty->t_write)
-       vty->t_write = thread_add_write (master, vty_flush, vty, sock);
+       vty->t_write = thread_add_write (vty_master, vty_flush, vty, sock);
       break;
     case VTY_TIMEOUT_RESET:
       if (vty->t_timeout)
@@ -2577,7 +2576,7 @@ vty_event (enum event event, int sock, struct vty *vty)
       if (vty->v_timeout)
        {
          vty->t_timeout = 
-           thread_add_timer (master, vty_timeout, vty, vty->v_timeout);
+           thread_add_timer (vty_master, vty_timeout, vty, vty->v_timeout);
        }
       break;
     }
@@ -3002,7 +3001,7 @@ vty_init (struct thread_master *master_thread)
 
   vtyvec = vector_init (VECTOR_MIN_SIZE);
 
-  master = master_thread;
+  vty_master = master_thread;
 
   /* Initilize server thread vector. */
   Vvty_serv_thread = vector_init (VECTOR_MIN_SIZE);