[Glibc-bsd-commits] r2199 - trunk/freebsd-utils
ps-guest at alioth.debian.org
ps-guest at alioth.debian.org
Tue Jun 24 18:06:15 UTC 2008
Author: ps-guest
Date: 2008-06-24 18:06:14 +0000 (Tue, 24 Jun 2008)
New Revision: 2199
Modified:
trunk/freebsd-utils/getifaddrs.c
Log:
* do not abort() in any case
Modified: trunk/freebsd-utils/getifaddrs.c
===================================================================
--- trunk/freebsd-utils/getifaddrs.c 2008-06-24 17:52:52 UTC (rev 2198)
+++ trunk/freebsd-utils/getifaddrs.c 2008-06-24 18:06:14 UTC (rev 2199)
@@ -159,8 +159,10 @@
case RTM_NEWADDR:
ifam = (struct ifa_msghdr *)(void *)rtm;
if (idx && ifam->ifam_index != idx)
- abort(); /* this cannot happen */
-
+ {
+ errno = EINVAL; /* this cannot happen */
+ return -1;
+ };
#define RTA_MASKS (RTA_NETMASK | RTA_IFA | RTA_BRD)
if (idx == 0 || (ifam->ifam_addrs & RTA_MASKS) == 0)
break;
@@ -263,8 +265,10 @@
case RTM_NEWADDR:
ifam = (struct ifa_msghdr *)(void *)rtm;
if (idx && ifam->ifam_index != idx)
- abort(); /* this cannot happen */
-
+ {
+ errno = EINVAL; /* this cannot happen */
+ return -1;
+ };
if (idx == 0 || (ifam->ifam_addrs & RTA_MASKS) == 0)
break;
ift->ifa_name = cif->ifa_name;
More information about the Glibc-bsd-commits
mailing list