diff options
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/stdio/_flock_stub.c | 3 | ||||
-rw-r--r-- | lib/libc/stdio/fdopen.c | 3 | ||||
-rw-r--r-- | lib/libc/stdio/fgetwln.c | 2 | ||||
-rw-r--r-- | lib/libc/stdio/findfp.c | 7 | ||||
-rw-r--r-- | lib/libc/stdio/freopen.c | 5 | ||||
-rw-r--r-- | lib/libc/stdio/getchar.c | 2 | ||||
-rw-r--r-- | lib/libc/stdio/printf_l.3 | 1 | ||||
-rw-r--r-- | lib/libc/stdio/scanf_l.3 | 1 | ||||
-rw-r--r-- | lib/libc/stdio/vfscanf.c | 4 | ||||
-rw-r--r-- | lib/libc/tests/net/Makefile | 4 |
10 files changed, 20 insertions, 12 deletions
diff --git a/lib/libc/stdio/_flock_stub.c b/lib/libc/stdio/_flock_stub.c index 0b61315..f53df35 100644 --- a/lib/libc/stdio/_flock_stub.c +++ b/lib/libc/stdio/_flock_stub.c @@ -55,6 +55,9 @@ __weak_reference(_flockfile_debug_stub, _flockfile_debug); __weak_reference(_ftrylockfile, ftrylockfile); __weak_reference(_funlockfile, funlockfile); +void _flockfile_debug_stub(FILE *, char *, int); +int _ftrylockfile(FILE *); + void _flockfile(FILE *fp) { diff --git a/lib/libc/stdio/fdopen.c b/lib/libc/stdio/fdopen.c index e5d167a..fbe37e8 100644 --- a/lib/libc/stdio/fdopen.c +++ b/lib/libc/stdio/fdopen.c @@ -70,7 +70,8 @@ fdopen(int fd, const char *mode) /* Make sure the mode the user wants is a subset of the actual mode. */ if ((fdflags = _fcntl(fd, F_GETFL, 0)) < 0) return (NULL); - tmp = fdflags & O_ACCMODE; + /* Work around incorrect O_ACCMODE. */ + tmp = fdflags & (O_ACCMODE | O_EXEC); if (tmp != O_RDWR && (tmp != (oflags & O_ACCMODE))) { errno = EINVAL; return (NULL); diff --git a/lib/libc/stdio/fgetwln.c b/lib/libc/stdio/fgetwln.c index 6d9087b..8439496 100644 --- a/lib/libc/stdio/fgetwln.c +++ b/lib/libc/stdio/fgetwln.c @@ -40,6 +40,8 @@ __FBSDID("$FreeBSD$"); #include "local.h" #include "xlocale_private.h" +wchar_t *fgetwln_l(FILE * __restrict, size_t *, locale_t); + wchar_t * fgetwln_l(FILE * __restrict fp, size_t *lenp, locale_t locale) { diff --git a/lib/libc/stdio/findfp.c b/lib/libc/stdio/findfp.c index 12d3659..b8bb5af 100644 --- a/lib/libc/stdio/findfp.c +++ b/lib/libc/stdio/findfp.c @@ -113,7 +113,7 @@ moreglue(int n) * Find a free FILE for fopen et al. */ FILE * -__sfp() +__sfp(void) { FILE *fp; int n; @@ -165,6 +165,7 @@ found: */ __warn_references(f_prealloc, "warning: this program uses f_prealloc(), which is not recommended."); +void f_prealloc(void); void f_prealloc(void) @@ -196,7 +197,7 @@ f_prealloc(void) * The name `_cleanup' is, alas, fairly well known outside stdio. */ void -_cleanup() +_cleanup(void) { /* (void) _fwalk(fclose); */ (void) _fwalk(__sflush); /* `cheating' */ @@ -206,7 +207,7 @@ _cleanup() * __sinit() is called whenever stdio's internal variables must be set up. */ void -__sinit() +__sinit(void) { /* Make sure we clean up on exit. */ diff --git a/lib/libc/stdio/freopen.c b/lib/libc/stdio/freopen.c index 58227fa..e0104c8 100644 --- a/lib/libc/stdio/freopen.c +++ b/lib/libc/stdio/freopen.c @@ -92,8 +92,9 @@ freopen(const char * __restrict file, const char * __restrict mode, errno = sverrno; return (NULL); } - if ((dflags & O_ACCMODE) != O_RDWR && (dflags & O_ACCMODE) != - (oflags & O_ACCMODE)) { + /* Work around incorrect O_ACCMODE. */ + if ((dflags & O_ACCMODE) != O_RDWR && + (dflags & (O_ACCMODE | O_EXEC)) != (oflags & O_ACCMODE)) { fclose(fp); FUNLOCKFILE(fp); errno = EBADF; diff --git a/lib/libc/stdio/getchar.c b/lib/libc/stdio/getchar.c index 21040bc..2815072 100644 --- a/lib/libc/stdio/getchar.c +++ b/lib/libc/stdio/getchar.c @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #undef getchar_unlocked int -getchar() +getchar(void) { int retval; FLOCKFILE(stdin); diff --git a/lib/libc/stdio/printf_l.3 b/lib/libc/stdio/printf_l.3 index 20c855b..312d110 100644 --- a/lib/libc/stdio/printf_l.3 +++ b/lib/libc/stdio/printf_l.3 @@ -43,6 +43,7 @@ .Lb libc .Sh SYNOPSIS .In stdio.h +.In xlocale.h .Ft int .Fn printf_l "locale_t loc" "const char * restrict format" "..." .Ft int diff --git a/lib/libc/stdio/scanf_l.3 b/lib/libc/stdio/scanf_l.3 index 405601e..35a8241 100644 --- a/lib/libc/stdio/scanf_l.3 +++ b/lib/libc/stdio/scanf_l.3 @@ -39,6 +39,7 @@ .Lb libc .Sh SYNOPSIS .In stdio.h +.In xlocale.h .Ft int .Fn scanf_l "locale_t loc" "const char * restrict format" "..." .Ft int diff --git a/lib/libc/stdio/vfscanf.c b/lib/libc/stdio/vfscanf.c index 50f0690..b537263 100644 --- a/lib/libc/stdio/vfscanf.c +++ b/lib/libc/stdio/vfscanf.c @@ -814,9 +814,7 @@ match_failure: * considered part of the scanset. */ static const u_char * -__sccl(tab, fmt) - char *tab; - const u_char *fmt; +__sccl(char *tab, const u_char *fmt) { int c, n, v, i; struct xlocale_collate *table = diff --git a/lib/libc/tests/net/Makefile b/lib/libc/tests/net/Makefile index b8f6d97..a88f44f 100644 --- a/lib/libc/tests/net/Makefile +++ b/lib/libc/tests/net/Makefile @@ -29,8 +29,8 @@ DPADD.h_nsd_recurse+= ${LIBPTHREAD} LDADD.h_nsd_recurse+= -lpthread CLEANFILES+= aton_ether_subr.c -aton_ether_subr.c: gen_ether_subr ${SRCTOP}/sys/net/if_ethersubr.c - ${HOST_SH} ${.ALLSRC} ${.TARGET} +aton_ether_subr.c: gen_ether_subr ${.CURDIR:H:H:H:H}/sys/net/if_ethersubr.c + ${__MAKE_SHELL} ${.ALLSRC} ${.TARGET} .include "../Makefile.netbsd-tests" |