1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-01 10:06:57 +03:00
* misc/getusershell.c: Make strings in okshells array const.
	* misc/regexp.c: Add const to cast to avoid warnings.
	* sysdeps/unix/sysv/linux/llseek.c: Add prototype for __llseek.
	* sysdeps/unix/sysv/linux/i386/setresuid.c: Add prototype for
	__setresuid.
	* sysdeps/unix/sysv/linux/i386/setresgid.c: Add prototype for
	setresgid.
	* misc/error.c: Add prototypes for __error and __error_at_line.
	* misc/mntent_r.c (__getmntent_r): Add break at end of switch
	statement to avoid warning.
This commit is contained in:
Ulrich Drepper
2000-11-28 07:40:13 +00:00
parent 8c0b717095
commit 49f3a75859
8 changed files with 31 additions and 9 deletions

View File

@ -45,8 +45,7 @@ static char sccsid[] = "@(#)getusershell.c 8.1 (Berkeley) 6/4/93";
* /etc/shells.
*/
static char *okshells[] = { (char *) _PATH_BSHELL, (char *) _PATH_CSHELL,
NULL };
static const char *okshells[] = { _PATH_BSHELL, _PATH_CSHELL, NULL };
static char **curshell, **shells, *strings;
static char **initshells __P((void));
@ -101,21 +100,21 @@ initshells()
free(strings);
strings = NULL;
if ((fp = fopen(_PATH_SHELLS, "r")) == NULL)
return (okshells);
return (char **) okshells;
if (fstat64(fileno(fp), &statb) == -1) {
(void)fclose(fp);
return (okshells);
return (char **) okshells;
}
if ((strings = malloc((u_int)statb.st_size + 1)) == NULL) {
(void)fclose(fp);
return (okshells);
return (char **) okshells;
}
shells = calloc((unsigned)statb.st_size / 3, sizeof (char *));
if (shells == NULL) {
(void)fclose(fp);
free(strings);
strings = NULL;
return (okshells);
return (char **) okshells;
}
sp = shells;
cp = strings;