2005-12-20 Ulrich Drepper <drepper@redhat.com>
+ * misc/getusershell.c (initshells): Remove unnecessary tests.
+ (endusershell): Likewise.
+ (okshells): Mark as const.
+
* sysdeps/posix/gai_strerror.c: Complete rewrite. Avoid relocations.
* sysdeps/posix/gai_strerror-strs.h: New file.
* sysdeps/posix/Dist: New file.
* /etc/shells.
*/
-static const char *okshells[] = { _PATH_BSHELL, _PATH_CSHELL, NULL };
+static const char *const okshells[] = { _PATH_BSHELL, _PATH_CSHELL, NULL };
static char **curshell, **shells, *strings;
static char **initshells (void) __THROW;
endusershell()
{
- if (shells != NULL)
- free(shells);
+ free(shells);
shells = NULL;
- if (strings != NULL)
- free(strings);
+ free(strings);
strings = NULL;
curshell = NULL;
}
struct stat64 statb;
int flen;
- if (shells != NULL)
- free(shells);
+ free(shells);
shells = NULL;
- if (strings != NULL)
- free(strings);
+ free(strings);
strings = NULL;
if ((fp = fopen(_PATH_SHELLS, "rc")) == NULL)
return (char **) okshells;
strings = NULL;
return (char **) okshells;
}
- /* No threads using this stream. */
- __fsetlocking (fp, FSETLOCKING_BYCALLER);
sp = shells;
cp = strings;
flen = statb.st_size;