From b83cbb99bdd2019f70ffbcca52e5a977437ed421 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 13 Jun 2002 09:02:29 +0000 Subject: * sysdeps/mach/hurd/dl-sysdep.c (_dl_sysdep_start: go): Fix arg type. * sysdeps/mach/hurd/if_index.c (if_nameindex): Use size_t for AMOUNT argument to pfinet_siocgifconf RPC. --- sysdeps/mach/hurd/if_index.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'sysdeps/mach/hurd/if_index.c') diff --git a/sysdeps/mach/hurd/if_index.c b/sysdeps/mach/hurd/if_index.c index 7a58c9c5d1..63dad54124 100644 --- a/sysdeps/mach/hurd/if_index.c +++ b/sysdeps/mach/hurd/if_index.c @@ -1,5 +1,5 @@ /* Find network interface names and index numbers. Hurd version. - Copyright (C) 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 2000,01,02 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -80,7 +80,6 @@ if_nameindex (void) struct if_nameindex *idx = NULL; ifc.ifc_buf = data; - ifc.ifc_len = sizeof (data); if (fd < 0) return NULL; @@ -90,8 +89,8 @@ if_nameindex (void) nifs = 0; else { - err = __pfinet_siocgifconf (server, -1, &ifc.ifc_buf, - &ifc.ifc_len); + size_t len = sizeof data; + err = __pfinet_siocgifconf (server, -1, &ifc.ifc_buf, &len); if (err == MACH_SEND_INVALID_DEST || err == MIG_SERVER_DIED) { /* On the first use of the socket server during the operation, @@ -99,13 +98,13 @@ if_nameindex (void) server = _hurd_socket_server (PF_INET, 1); if (server == MACH_PORT_NULL) goto out; - err = __pfinet_siocgifconf (server, -1, &ifc.ifc_buf, - &ifc.ifc_len); + err = __pfinet_siocgifconf (server, -1, &ifc.ifc_buf, &len); } if (err) goto out; - nifs = ifc.ifc_len / sizeof (struct ifreq); + ifc.ifc_len = len; + nifs = len / sizeof (struct ifreq); } idx = malloc ((nifs + 1) * sizeof (struct if_nameindex)); -- cgit 1.4.1