summaryrefslogtreecommitdiffstats
path: root/vtysh
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2015-03-04 07:18:24 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2015-04-21 10:19:06 +0200
commit6769f43de9d595b935f2ebf1cae1428e1d1a3a5f (patch)
tree564d37a5c20e0511189d54c245faf7dab955d9b6 /vtysh
parenta9eb9063071437f5cde3b78adf273b428c49d378 (diff)
downloadquagga-6769f43de9d595b935f2ebf1cae1428e1d1a3a5f.tar.bz2
quagga-6769f43de9d595b935f2ebf1cae1428e1d1a3a5f.tar.xz
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>
Diffstat (limited to 'vtysh')
-rw-r--r--vtysh/vtysh.c15
-rw-r--r--vtysh/vtysh_main.c10
2 files changed, 8 insertions, 17 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index d64b4e00..fbbc88d0 100644
--- a/vtysh/vtysh.c
+++ b/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;
diff --git a/vtysh/vtysh_main.c b/vtysh/vtysh_main.c
index d2436709..aa7d0218 100644
--- a/vtysh/vtysh_main.c
+++ b/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. */