From 4460e7a4cf3dadcd9f06e4b519ba7be2cc936c0a Mon Sep 17 00:00:00 2001 From: ajs Date: Sat, 29 Jan 2005 17:07:40 +0000 Subject: 2005-01-29 Andrew J. Schorr * if_ioctl_solaris.c: (interface_list_ioctl) Save errno before calling zserv_privs.change. * ioctl{,_solaris}.c: (if_ioctl,if_ioctl_ipv6) Save errno before calling zserv_privs.change. * ipforward_solaris.c: (solaris_nd) Save errno before calling zserv_privs.change. * irdp_main.c: (irdp_sock_init) Save errno before calling zserv_privs.change. [backport candidate] --- zebra/if_ioctl_solaris.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'zebra/if_ioctl_solaris.c') diff --git a/zebra/if_ioctl_solaris.c b/zebra/if_ioctl_solaris.c index 1cbf555e..38ac5a71 100644 --- a/zebra/if_ioctl_solaris.c +++ b/zebra/if_ioctl_solaris.c @@ -50,6 +50,7 @@ interface_list_ioctl (int af) struct lifconf lifconf; struct interface *ifp; int n; + int save_errno; size_t needed, lastneeded = 0; char *buf = NULL; @@ -72,6 +73,7 @@ calculate_lifc_len: /* must hold privileges to enter here */ lifn.lifn_family = af; lifn.lifn_flags = 0; ret = ioctl (sock, SIOCGLIFNUM, &lifn); + save_errno = errno; if (zserv_privs.change(ZPRIVS_LOWER)) zlog (NULL, LOG_ERR, "Can't lower privileges"); @@ -79,7 +81,7 @@ calculate_lifc_len: /* must hold privileges to enter here */ if (ret < 0) { zlog_warn ("interface_list_ioctl: SIOCGLIFNUM failed %s", - safe_strerror (errno)); + safe_strerror (save_errno)); close (sock); return -1; } -- cgit v1.2.1