Quagga: Fix compile warnings for GCC4.9

As part of the debian build process for jessie we are seeing
some compile issues.  This addresses these issues

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2015-09-24 16:57:36 -07:00
parent 7dfe5b9499
commit 77f2455171
6 changed files with 44 additions and 15 deletions

View File

@ -1081,7 +1081,7 @@ DEFUN (debug_bgp_update_direct_peer,
{
struct peer *peer;
struct peer_af *paf;
int af;
enum bgp_af_index af;
bgp_debug_list_add_entry(bgp_debug_update_out_peers, host, NULL);
peer = bgp_find_peer (vty, host);
@ -1220,7 +1220,7 @@ DEFUN (no_debug_bgp_update_direct_peer,
struct peer *peer;
struct peer_af *paf;
int af;
enum bgp_af_index af;
peer = bgp_find_peer (vty, host);
if (peer)

View File

@ -2200,7 +2200,7 @@ bgp_process_queue_init (void)
bm->process_main_queue->spec.yield = 50 * 1000L;
memcpy (bm->process_rsclient_queue, bm->process_main_queue,
sizeof (struct work_queue *));
sizeof (struct work_queue));
bm->process_rsclient_queue->spec.workfunc = &bgp_process_rsclient;
}

View File

@ -517,7 +517,7 @@ static inline void
update_group_adjust_peer_afs (struct peer *peer)
{
struct peer_af *paf;
afi_t afi;
enum bgp_af_index afi;
PEERAF_FOREACH (peer, paf, afi) update_group_adjust_peer (paf);
}
@ -531,7 +531,7 @@ static inline void
update_group_remove_peer_afs (struct peer *peer)
{
struct peer_af *paf;
afi_t afi;
enum bgp_af_index afi;
PEERAF_FOREACH (peer, paf, afi)
update_subgroup_remove_peer (PAF_SUBGRP (paf), paf);
@ -581,7 +581,7 @@ static inline void
bgp_announce_peer (struct peer *peer)
{
struct peer_af *paf;
int af;
enum bgp_af_index af;
PEERAF_FOREACH (peer, paf, af) subgroup_announce_all (PAF_SUBGRP (paf));
}

View File

@ -1091,7 +1091,7 @@ peer_xfer_config (struct peer *peer_dst, struct peer *peer_src)
struct peer_af *paf;
afi_t afi;
safi_t safi;
int afindex;
enum bgp_af_index afindex;
assert(peer_src);
assert(peer_dst);

View File

@ -2311,8 +2311,16 @@ vty_use_backup_config (char *fullpath)
}
while((c = read (sav, buffer, 512)) > 0)
write (tmp, buffer, c);
{
if (write (tmp, buffer, c) <= 0)
{
free (fullpath_sav);
free (fullpath_tmp);
close (sav);
close (tmp);
return NULL;
}
}
close (sav);
close (tmp);
@ -2349,7 +2357,11 @@ vty_read_config (char *config_file,
{
if (! IS_DIRECTORY_SEP (config_file[0]))
{
getcwd (cwd, MAXPATHLEN);
if (getcwd (cwd, MAXPATHLEN) == NULL)
{
fprintf (stderr, "Failure to determine Current Working Directory %d!\n", errno);
exit (1);
}
tmp = XMALLOC (MTYPE_TMP,
strlen (cwd) + strlen (config_file) + 2);
sprintf (tmp, "%s/%s", cwd, config_file);
@ -2484,7 +2496,11 @@ vty_log_fixed (char *buf, size_t len)
if (((vty = vector_slot (vtyvec, i)) != NULL) && vty->monitor)
/* N.B. We don't care about the return code, since process is
most likely just about to die anyway. */
writev(vty->fd, iov, 2);
if (writev(vty->fd, iov, 2) == -1)
{
fprintf(stderr, "Failure to writev: %d\n", errno);
exit(-1);
}
}
}
@ -2932,8 +2948,21 @@ vty_save_cwd (void)
if (!c)
{
chdir (SYSCONFDIR);
getcwd (cwd, MAXPATHLEN);
/*
* At this point if these go wrong, more than likely
* the whole world is coming down around us
* Hence not worrying about it too much.
*/
if (!chdir (SYSCONFDIR))
{
fprintf(stderr, "Failure to chdir to %s, errno: %d\n", SYSCONFDIR, errno);
exit(-1);
}
if (getcwd (cwd, MAXPATHLEN) == NULL)
{
fprintf(stderr, "Failure to getcwd, errno: %d\n", errno);
exit(-1);
}
}
vty_cwd = XMALLOC (MTYPE_TMP, strlen (cwd) + 1);

View File

@ -242,8 +242,8 @@ router_id_init (void)
install_element (CONFIG_NODE, &router_id_cmd);
install_element (CONFIG_NODE, &no_router_id_cmd);
memset (rid_all_sorted_list, 0, sizeof (rid_all_sorted_list));
memset (rid_lo_sorted_list, 0, sizeof (rid_lo_sorted_list));
memset (rid_all_sorted_list, 0, sizeof (_rid_all_sorted_list));
memset (rid_lo_sorted_list, 0, sizeof (_rid_lo_sorted_list));
memset (&rid_user_assigned, 0, sizeof (rid_user_assigned));
rid_all_sorted_list->cmp = router_id_cmp;