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/lib/sockunion.c b/lib/sockunion.c
index 78e02f2..7157b49 100644
--- a/lib/sockunion.c
+++ b/lib/sockunion.c
@@ -236,7 +236,7 @@
sock = socket (su->sa.sa_family, SOCK_STREAM, 0);
if (sock < 0)
{
- zlog (NULL, LOG_WARNING, "Can't make socket : %s", strerror (errno));
+ zlog (NULL, LOG_WARNING, "Can't make socket : %s", safe_strerror (errno));
return -1;
}
@@ -377,7 +377,7 @@
if (errno != EINPROGRESS)
{
zlog_info ("can't connect to %s fd %d : %s",
- sockunion_log (&su), fd, strerror (errno));
+ sockunion_log (&su), fd, safe_strerror (errno));
return connect_error;
}
}
@@ -444,7 +444,7 @@
ret = bind (sock, (struct sockaddr *)su, size);
if (ret < 0)
- zlog (NULL, LOG_WARNING, "can't bind socket : %s", strerror (errno));
+ zlog (NULL, LOG_WARNING, "can't bind socket : %s", safe_strerror (errno));
return ret;
}
@@ -576,7 +576,7 @@
if (ret < 0)
{
zlog_warn ("Can't get local address and port by getsockname: %s",
- strerror (errno));
+ safe_strerror (errno));
return NULL;
}
@@ -630,7 +630,7 @@
if (ret < 0)
{
zlog (NULL, LOG_WARNING, "Can't get remote address and port: %s",
- strerror (errno));
+ safe_strerror (errno));
return NULL;
}