2004-11-19 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* global: Replace strerror with safe_strerror. And vtysh/vtysh.c
needs to include "log.h" to pick up the declaration.
diff --git a/isisd/isis_network.c b/isisd/isis_network.c
index 4fbf16f..a1dc582 100644
--- a/isisd/isis_network.c
+++ b/isisd/isis_network.c
@@ -130,7 +130,7 @@
if (setsockopt (fd, SOL_PACKET, PACKET_ADD_MEMBERSHIP, &mreq,
sizeof (struct packet_mreq)))
{
- zlog_warn ("isis_multicast_join(): setsockopt(): %s", strerror (errno));
+ zlog_warn ("isis_multicast_join(): setsockopt(): %s", safe_strerror (errno));
return ISIS_WARNING;
}
@@ -147,7 +147,7 @@
if (fd < 0)
{
zlog_warn ("open_packet_socket(): socket() failed %s",
- strerror (errno));
+ safe_strerror (errno));
return ISIS_WARNING;
}
@@ -162,7 +162,7 @@
if (bind (fd, (struct sockaddr *) (&s_addr),
sizeof (struct sockaddr_ll)) < 0)
{
- zlog_warn ("open_packet_socket(): bind() failed: %s", strerror (errno));
+ zlog_warn ("open_packet_socket(): bind() failed: %s", safe_strerror (errno));
return ISIS_WARNING;
}
@@ -222,7 +222,7 @@
if (fd < 0)
{
zlog_warn ("open_bpf_dev(): failed to create bpf socket: %s",
- strerror (errno));
+ safe_strerror (errno));
return ISIS_WARNING;
}
@@ -232,7 +232,7 @@
if (ioctl (fd, BIOCSETIF, (caddr_t) & ifr) < 0)
{
zlog_warn ("open_bpf_dev(): failed to bind to interface: %s",
- strerror (errno));
+ safe_strerror (errno));
return ISIS_WARNING;
}
@@ -307,7 +307,7 @@
if (ioctl (fd, BIOCSETF, (caddr_t) & bpf_prog) < 0)
{
zlog_warn ("open_bpf_dev(): failed to install filter: %s",
- strerror (errno));
+ safe_strerror (errno));
return ISIS_WARNING;
}
@@ -329,7 +329,7 @@
int retval = ISIS_OK;
if (isisd_privs.change (ZPRIVS_RAISE))
- zlog_err ("%s: could not raise privs, %s", __func__, strerror (errno));
+ zlog_err ("%s: could not raise privs, %s", __func__, safe_strerror (errno));
#ifdef GNU_LINUX
retval = open_packet_socket (circuit);
@@ -362,7 +362,7 @@
end:
if (isisd_privs.change (ZPRIVS_LOWER))
- zlog_err ("%s: could not lower privs, %s", __func__, strerror (errno));
+ zlog_err ("%s: could not lower privs, %s", __func__, safe_strerror (errno));
return retval;
}
@@ -395,7 +395,7 @@
if (bytesread < 0)
{
zlog_warn ("isis_recv_packet_bcast(): fd %d, recvfrom (): %s",
- circuit->fd, strerror (errno));
+ circuit->fd, safe_strerror (errno));
zlog_warn ("circuit is %s", circuit->interface->name);
zlog_warn ("circuit fd %d", circuit->fd);
zlog_warn ("bytesread %d", bytesread);
@@ -549,7 +549,7 @@
if (ioctl (circuit->fd, FIONREAD, (caddr_t) & bytestoread) < 0)
{
- zlog_warn ("ioctl() FIONREAD failed: %s", strerror (errno));
+ zlog_warn ("ioctl() FIONREAD failed: %s", safe_strerror (errno));
}
if (bytestoread)
@@ -559,7 +559,7 @@
if (bytesread < 0)
{
zlog_warn ("isis_recv_pdu_bcast(): read() failed: %s",
- strerror (errno));
+ safe_strerror (errno));
return ISIS_WARNING;
}
@@ -584,7 +584,7 @@
ETHER_ADDR_LEN);
if (ioctl (circuit->fd, BIOCFLUSH, &one) < 0)
- zlog_warn ("Flushing failed: %s", strerror (errno));
+ zlog_warn ("Flushing failed: %s", safe_strerror (errno));
return ISIS_OK;
}
@@ -599,7 +599,7 @@
if (bytesread < 0)
{
- zlog_warn ("isis_recv_pdu_p2p(): read () failed: %s", strerror (errno));
+ zlog_warn ("isis_recv_pdu_p2p(): read () failed: %s", safe_strerror (errno));
return ISIS_WARNING;
}
diff --git a/isisd/modified/thread.c b/isisd/modified/thread.c
index af954b8..8364c4d 100644
--- a/isisd/modified/thread.c
+++ b/isisd/modified/thread.c
@@ -611,7 +611,7 @@
if (errno == EINTR)
continue;
- zlog_warn ("select() error: %s", strerror (errno));
+ zlog_warn ("select() error: %s", safe_strerror (errno));
return NULL;
}
diff --git a/isisd/modified/vty.c b/isisd/modified/vty.c
index 6de0e0d..2a1f466 100644
--- a/isisd/modified/vty.c
+++ b/isisd/modified/vty.c
@@ -1638,7 +1638,7 @@
vty_sock = sockunion_accept (accept_sock, &su);
if (vty_sock < 0)
{
- zlog_warn ("can't accept vty socket : %s", strerror (errno));
+ zlog_warn ("can't accept vty socket : %s", safe_strerror (errno));
return -1;
}
@@ -1695,7 +1695,7 @@
(char *) &on, sizeof (on));
if (ret < 0)
zlog (NULL, LOG_INFO, "can't set sockopt to vty_sock : %s",
- strerror (errno));
+ safe_strerror (errno));
vty = vty_create (vty_sock, &su);
@@ -1889,7 +1889,7 @@
if (sock < 0)
{
- zlog_warn ("can't accept vty socket : %s", strerror (errno));
+ zlog_warn ("can't accept vty socket : %s", safe_strerror (errno));
return -1;
}