2005-01-30 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* daemon.c: (daemon) Replace perror with zlog_err.
* vty.c: (vty_serv_un) Replace perror with zlog_err.
* ripd.c: (rip_create_socket) Replace perror with zlog_err.
* ioctl.c: (if_ioctl,if_ioctl_ipv6,if_get_flags) Replace perror with
zlog_err.
* ioctl_solaris.c: (if_ioctl,if_ioctl_ipv6) Replace perror with
zlog_err.
diff --git a/zebra/ioctl.c b/zebra/ioctl.c
index e28d359..56de810 100644
--- a/zebra/ioctl.c
+++ b/zebra/ioctl.c
@@ -54,9 +54,10 @@
sock = socket (AF_INET, SOCK_DGRAM, 0);
if (sock < 0)
{
+ int save_errno = errno;
if (zserv_privs.change(ZPRIVS_LOWER))
zlog (NULL, LOG_ERR, "Can't lower privileges");
- perror ("socket");
+ zlog_err("Cannot create UDP socket: %s", safe_strerror(save_errno));
exit (1);
}
if ((ret = ioctl (sock, request, buffer)) < 0)
@@ -86,9 +87,11 @@
sock = socket (AF_INET6, SOCK_DGRAM, 0);
if (sock < 0)
{
+ int save_errno = errno;
if (zserv_privs.change(ZPRIVS_LOWER))
zlog (NULL, LOG_ERR, "Can't lower privileges");
- perror ("socket");
+ zlog_err("Cannot create IPv6 datagram socket: %s",
+ safe_strerror(save_errno));
exit (1);
}
@@ -343,7 +346,7 @@
ret = if_ioctl (SIOCGIFFLAGS, (caddr_t) &ifreq);
if (ret < 0)
{
- perror ("ioctl");
+ zlog_err("if_ioctl(SIOCGIFFLAGS) failed: %s", safe_strerror(errno));
return;
}