From 49f3a758597f7904ba7e779156df8f9b61c06303 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 28 Nov 2000 07:40:13 +0000 Subject: [PATCH] Update. * 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. --- ChangeLog | 10 ++++++++++ misc/error.c | 4 ++++ misc/getusershell.c | 11 +++++------ misc/mntent_r.c | 3 ++- misc/regexp.c | 6 ++++-- sysdeps/unix/sysv/linux/i386/setresgid.c | 2 ++ sysdeps/unix/sysv/linux/i386/setresuid.c | 2 ++ sysdeps/unix/sysv/linux/llseek.c | 2 ++ 8 files changed, 31 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index cbe8df02a9..1550e07228 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2000-11-27 Ulrich Drepper + * 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. * test-skeleton.c: Mark timeout_handler with noreturn. * iconv/skeleton.c (get16u): Add const to cast. (get32u): Likewise. diff --git a/misc/error.c b/misc/error.c index 690b5bdc99..599de78629 100644 --- a/misc/error.c +++ b/misc/error.c @@ -74,6 +74,10 @@ unsigned int error_message_count; /* In GNU libc we want do not want to use the common name `error' directly. Instead make it a weak alias. */ +extern void __error (int status, int errnum, const char *message, ...); +extern void __error_at_line (int status, int errnum, const char *file_name, + unsigned int line_number, const char *message, + ...); # define error __error # define error_at_line __error_at_line diff --git a/misc/getusershell.c b/misc/getusershell.c index 9e22125133..5ac08ce7f8 100644 --- a/misc/getusershell.c +++ b/misc/getusershell.c @@ -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; diff --git a/misc/mntent_r.c b/misc/mntent_r.c index 78b1c2dcea..5ba404d4de 100644 --- a/misc/mntent_r.c +++ b/misc/mntent_r.c @@ -1,5 +1,5 @@ /* Utilities for reading/writing fstab, mtab, etc. - Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1995,1996,1997,1998,1999,2000 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 @@ -144,6 +144,7 @@ __getmntent_r (FILE *stream, struct mntent *mp, char *buffer, int bufsiz) case 1: mp->mnt_passno = 0; case 2: + break; } funlockfile (stream); diff --git a/misc/regexp.c b/misc/regexp.c index fbc32e74d0..3308239876 100644 --- a/misc/regexp.c +++ b/misc/regexp.c @@ -33,6 +33,7 @@ char *locs; found in the buffer starting at EXPBUF. `loc1' will return the first character matched and `loc2' points to the next unmatched character. */ +extern int __step (const char *string, const char *expbuf); int __step (const char *string, const char *expbuf) { @@ -41,7 +42,7 @@ __step (const char *string, const char *expbuf) expbuf += __alignof (regex_t *); expbuf -= (expbuf - ((const char *) 0)) % __alignof__ (regex_t *); - if (__regexec ((regex_t *) expbuf, string, 1, &match, REG_NOTEOL) + if (__regexec ((const regex_t *) expbuf, string, 1, &match, REG_NOTEOL) == REG_NOMATCH) return 0; @@ -55,6 +56,7 @@ weak_alias (__step, step) /* Match the beginning of STRING with the compiled regular expression in EXPBUF. If the match is successful `loc2' will contain the position of the first unmatched character. */ +extern int __advance (const char *string, const char *expbuf); int __advance (const char *string, const char *expbuf) { @@ -63,7 +65,7 @@ __advance (const char *string, const char *expbuf) expbuf += __alignof__ (regex_t *); expbuf -= (expbuf - ((const char *) 0)) % __alignof__ (regex_t *); - if (__regexec ((regex_t *) expbuf, string, 1, &match, REG_NOTEOL) + if (__regexec ((const regex_t *) expbuf, string, 1, &match, REG_NOTEOL) == REG_NOMATCH /* We have to check whether the check is at the beginning of the buffer. */ diff --git a/sysdeps/unix/sysv/linux/i386/setresgid.c b/sysdeps/unix/sysv/linux/i386/setresgid.c index 51ee2141ed..5d77f4da74 100644 --- a/sysdeps/unix/sysv/linux/i386/setresgid.c +++ b/sysdeps/unix/sysv/linux/i386/setresgid.c @@ -41,6 +41,8 @@ extern int __libc_missing_32bit_uids; # endif # endif /* __NR_setresgid32 */ +extern int setresgid (gid_t rgid, gid_t egid, gid_t sgid); + int setresgid (gid_t rgid, gid_t egid, gid_t sgid) { diff --git a/sysdeps/unix/sysv/linux/i386/setresuid.c b/sysdeps/unix/sysv/linux/i386/setresuid.c index e5723a0336..55f22acc0f 100644 --- a/sysdeps/unix/sysv/linux/i386/setresuid.c +++ b/sysdeps/unix/sysv/linux/i386/setresuid.c @@ -41,6 +41,8 @@ extern int __libc_missing_32bit_uids; # endif # endif /* __NR_setresuid32 */ +extern int __setresuid (uid_t ruid, uid_t euid, uid_t suid); + int __setresuid (uid_t ruid, uid_t euid, uid_t suid) { diff --git a/sysdeps/unix/sysv/linux/llseek.c b/sysdeps/unix/sysv/linux/llseek.c index 280f83d72e..e62223ded1 100644 --- a/sysdeps/unix/sysv/linux/llseek.c +++ b/sysdeps/unix/sysv/linux/llseek.c @@ -27,6 +27,8 @@ extern int __syscall__llseek (int fd, off_t offset_hi, off_t offset_lo, loff_t *__unbounded result, int whence); /* Seek to OFFSET on FD, starting from WHENCE. */ +extern loff_t __llseek (int fd, loff_t offset, int whence); + loff_t __llseek (int fd, loff_t offset, int whence) { -- 2.43.5