summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2011-12-27 23:35:10 +0000
committerjilles <jilles@FreeBSD.org>2011-12-27 23:35:10 +0000
commit15457970de153acce9c3dc4ad0f50260cdf38b88 (patch)
tree4c3a7377d6de488b8f8f8bd072e2846904a6cb4d /lib
parent38173b70a257713ea47722d34867959945a22098 (diff)
downloadFreeBSD-src-15457970de153acce9c3dc4ad0f50260cdf38b88.zip
FreeBSD-src-15457970de153acce9c3dc4ad0f50260cdf38b88.tar.gz
libc: Eliminate some relative relocations in getusershell().
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/getusershell.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/libc/gen/getusershell.c b/lib/libc/gen/getusershell.c
index d09b50c..ce50069 100644
--- a/lib/libc/gen/getusershell.c
+++ b/lib/libc/gen/getusershell.c
@@ -58,12 +58,6 @@ __FBSDID("$FreeBSD$");
#endif
#include "un-namespace.h"
-/*
- * Local shells should NOT be added here. They should be added in
- * /etc/shells.
- */
-
-static const char *const okshells[] = { _PATH_BSHELL, _PATH_CSHELL, NULL };
static const char *const *curshell;
static StringList *sl;
@@ -261,8 +255,13 @@ initshells()
!= NS_SUCCESS) {
if (sl)
sl_free(sl, 1);
- sl = NULL;
- return (okshells);
+ sl = sl_init();
+ /*
+ * Local shells should NOT be added here. They should be
+ * added in /etc/shells.
+ */
+ sl_add(sl, strdup(_PATH_BSHELL));
+ sl_add(sl, strdup(_PATH_CSHELL));
}
sl_add(sl, NULL);
OpenPOWER on IntegriCloud