Browse Source

vtysh: drop unused variables & RETSIGTYPE

Drop unused return values in vtysh.  Also gets rid of the rather funny
prototyping of signal setup in vtysh - which as a side effect makes it
not need AC_TYPE_SIGNAL in configure.ac anymore.  It wasn't used
sensibly to begin with...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter 6 years ago
parent
commit
6769f43de9
3 changed files with 8 additions and 18 deletions
  1. 0 1
      configure.ac
  2. 6 9
      vtysh/vtysh.c
  3. 2 8
      vtysh/vtysh_main.c

+ 0 - 1
configure.ac

@@ -422,7 +422,6 @@ dnl AC_TYPE_PID_T
 AC_TYPE_UID_T
 AC_TYPE_MODE_T
 AC_TYPE_SIZE_T
-AC_TYPE_SIGNAL
 AC_STRUCT_TM
 
 dnl -------------------------

+ 6 - 9
vtysh/vtysh.c

@@ -1713,7 +1713,6 @@ DEFUN (vtysh_write_terminal,
        "Write to terminal\n")
 {
   u_int i;
-  int ret;
   char line[] = "write terminal\n";
   FILE *fp = NULL;
 
@@ -1735,7 +1734,7 @@ DEFUN (vtysh_write_terminal,
   vty_out (vty, "!%s", VTY_NEWLINE);
 
   for (i = 0; i < array_size(vtysh_client); i++)
-    ret = vtysh_client_config (&vtysh_client[i], line);
+    vtysh_client_config (&vtysh_client[i], line);
 
   /* Integrate vtysh specific configuration. */
   vtysh_config_write ();
@@ -1783,7 +1782,6 @@ static int
 write_config_integrated(void)
 {
   u_int i;
-  int ret;
   char line[] = "write terminal\n";
   FILE *fp;
   char *integrate_sav = NULL;
@@ -1809,7 +1807,7 @@ write_config_integrated(void)
     }
 
   for (i = 0; i < array_size(vtysh_client); i++)
-    ret = vtysh_client_config (&vtysh_client[i], line);
+    vtysh_client_config (&vtysh_client[i], line);
 
   vtysh_config_dump (fp);
 
@@ -1948,7 +1946,6 @@ static int
 execute_command (const char *command, int argc, const char *arg1,
 		 const char *arg2)
 {
-  int ret;
   pid_t pid;
   int status;
 
@@ -1967,13 +1964,13 @@ execute_command (const char *command, int argc, const char *arg1,
       switch (argc)
 	{
 	case 0:
-	  ret = execlp (command, command, (const char *)NULL);
+	  execlp (command, command, (const char *)NULL);
 	  break;
 	case 1:
-	  ret = execlp (command, command, arg1, (const char *)NULL);
+	  execlp (command, command, arg1, (const char *)NULL);
 	  break;
 	case 2:
-	  ret = execlp (command, command, arg1, arg2, (const char *)NULL);
+	  execlp (command, command, arg1, arg2, (const char *)NULL);
 	  break;
 	}
 
@@ -1985,7 +1982,7 @@ execute_command (const char *command, int argc, const char *arg1,
     {
       /* This is parent. */
       execute_flag = 1;
-      ret = wait4 (pid, &status, 0, NULL);
+      wait4 (pid, &status, 0, NULL);
       execute_flag = 0;
     }
   return 0;

+ 2 - 8
vtysh/vtysh_main.c

@@ -98,10 +98,9 @@ sigint (int sig)
 
 /* Signale wrapper for vtysh. We don't use sigevent because
  * vtysh doesn't use threads. TODO */
-RETSIGTYPE *
+static void
 vtysh_signal_set (int signo, void (*func)(int))
 {
-  int ret;
   struct sigaction sig;
   struct sigaction osig;
 
@@ -112,12 +111,7 @@ vtysh_signal_set (int signo, void (*func)(int))
   sig.sa_flags |= SA_RESTART;
 #endif /* SA_RESTART */
 
-  ret = sigaction (signo, &sig, &osig);
-
-  if (ret < 0) 
-    return (SIG_ERR);
-  else
-    return (osig.sa_handler);
+  sigaction (signo, &sig, &osig);
 }
 
 /* Initialization of signal handles. */