summaryrefslogtreecommitdiff
path: root/usr/src/lib/libdhcpsvc/modules
diff options
context:
space:
mode:
authorcasper <none@none>2005-11-09 11:19:56 -0800
committercasper <none@none>2005-11-09 11:19:56 -0800
commit4bc0a2ef2b7ba50a7a717e7ddbf31472ad28e358 (patch)
tree8076ef765d7019096fce872c8359a5345dee3160 /usr/src/lib/libdhcpsvc/modules
parent205d86ae4bc9e661871ff365f59324d8c9b0108a (diff)
downloadillumos-joyent-4bc0a2ef2b7ba50a7a717e7ddbf31472ad28e358.tar.gz
6346636 expunge readdir_r uses from Solaris
6346809 S_IFxxx is not a bitmask but our programmers don't know
Diffstat (limited to 'usr/src/lib/libdhcpsvc/modules')
-rw-r--r--usr/src/lib/libdhcpsvc/modules/binfiles/dhcp_network.c16
-rw-r--r--usr/src/lib/libdhcpsvc/modules/files/dhcp_network.c17
-rw-r--r--usr/src/lib/libdhcpsvc/modules/files0/dhcp_network.c17
3 files changed, 12 insertions, 38 deletions
diff --git a/usr/src/lib/libdhcpsvc/modules/binfiles/dhcp_network.c b/usr/src/lib/libdhcpsvc/modules/binfiles/dhcp_network.c
index e7120da2a9..195c42f56d 100644
--- a/usr/src/lib/libdhcpsvc/modules/binfiles/dhcp_network.c
+++ b/usr/src/lib/libdhcpsvc/modules/binfiles/dhcp_network.c
@@ -20,8 +20,8 @@
* CDDL HEADER END
*/
/*
- * Copyright (c) 2000 by Sun Microsystems, Inc.
- * All rights reserved.
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
@@ -1104,8 +1104,7 @@ int
list_dn(const char *location, char ***listppp, uint_t *countp)
{
char ipaddr[INET_ADDRSTRLEN];
- uint64_t direntbuf[(MAXPATHLEN + sizeof (struct dirent)) / 8];
- struct dirent *result, *dirent = (struct dirent *)&direntbuf;
+ struct dirent *result;
DIR *dirp;
unsigned int i, count = 0;
char *re, **new_listpp, **listpp = NULL;
@@ -1137,14 +1136,7 @@ list_dn(const char *location, char ***listppp, uint_t *countp)
if (re == NULL)
return (DSVC_NO_MEMORY);
- for (;;) {
- /*
- * readdir_r() is very broken; see 4329196 -- in the
- * meantime, workaround as best we can.
- */
- error = readdir_r(dirp, dirent, &result);
- if (error != 0 || result == NULL)
- break;
+ while ((result = readdir(dirp)) != NULL) {
if (regex(re, result->d_name, conver, ipaddr) != NULL) {
if (atoi(conver) != DSVC_CONVER)
diff --git a/usr/src/lib/libdhcpsvc/modules/files/dhcp_network.c b/usr/src/lib/libdhcpsvc/modules/files/dhcp_network.c
index e62c30f43a..898d2bf01b 100644
--- a/usr/src/lib/libdhcpsvc/modules/files/dhcp_network.c
+++ b/usr/src/lib/libdhcpsvc/modules/files/dhcp_network.c
@@ -20,8 +20,8 @@
* CDDL HEADER END
*/
/*
- * Copyright (c) 2000 by Sun Microsystems, Inc.
- * All rights reserved.
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
@@ -630,8 +630,7 @@ int
list_dn(const char *location, char ***listppp, uint_t *countp)
{
char ipaddr[INET_ADDRSTRLEN];
- uint64_t direntbuf[(MAXPATHLEN + sizeof (struct dirent)) / 8];
- struct dirent *result, *dirent = (struct dirent *)&direntbuf;
+ struct dirent *result;
DIR *dirp;
unsigned int i, count = 0;
char *re, **new_listpp, **listpp = NULL;
@@ -663,15 +662,7 @@ list_dn(const char *location, char ***listppp, uint_t *countp)
if (re == NULL)
return (DSVC_NO_MEMORY);
- for (;;) {
- /*
- * readdir_r() is very broken; see 4329196 -- in the
- * meantime, workaround as best we can.
- */
- error = readdir_r(dirp, dirent, &result);
- if (error != 0 || result == NULL)
- break;
-
+ while ((result = readdir(dirp)) != NULL) {
if (regex(re, result->d_name, conver, ipaddr) != NULL) {
if (atoi(conver) != DSVC_CONVER)
continue;
diff --git a/usr/src/lib/libdhcpsvc/modules/files0/dhcp_network.c b/usr/src/lib/libdhcpsvc/modules/files0/dhcp_network.c
index 1270fbb364..9442c3df6c 100644
--- a/usr/src/lib/libdhcpsvc/modules/files0/dhcp_network.c
+++ b/usr/src/lib/libdhcpsvc/modules/files0/dhcp_network.c
@@ -20,8 +20,8 @@
* CDDL HEADER END
*/
/*
- * Copyright (c) 2000-2001 by Sun Microsystems, Inc.
- * All rights reserved.
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
@@ -533,8 +533,7 @@ int
list_dn(const char *location, char ***listppp, uint_t *countp)
{
char ipaddr[INET_ADDRSTRLEN];
- uint64_t direntbuf[(MAXPATHLEN + sizeof (struct dirent)) / 8];
- struct dirent *result, *dirent = (struct dirent *)&direntbuf;
+ struct dirent *result;
DIR *dirp;
unsigned int i, count = 0;
char *re, **new_listpp, **listpp = NULL;
@@ -563,15 +562,7 @@ list_dn(const char *location, char ***listppp, uint_t *countp)
if (re == NULL)
return (DSVC_NO_MEMORY);
- for (;;) {
- /*
- * readdir_r() is very broken; see 4329196 -- in the
- * meantime, workaround as best we can.
- */
- error = readdir_r(dirp, dirent, &result);
- if (error != 0 || result == NULL)
- break;
-
+ while ((result = readdir(dirp)) != NULL) {
if (regex(re, result->d_name, ipaddr) != NULL) {
new_listpp = realloc(listpp,
(sizeof (char **)) * (count + 1));