diff options
author | dim <dim@FreeBSD.org> | 2015-02-17 19:53:41 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-02-17 19:53:41 +0000 |
commit | d27bd4650ea928097e260433cb5c69be0dda440f (patch) | |
tree | 9b840acec4a7a5a64b3092e4f4cbb8197e629360 /lib/libc | |
parent | 9377b5ad0feb5dd018ed6cfc6378ac19c1252dfe (diff) | |
parent | 68a4902d98c88ebff2f1dfd8bee849d62233ba60 (diff) | |
download | FreeBSD-src-d27bd4650ea928097e260433cb5c69be0dda440f.zip FreeBSD-src-d27bd4650ea928097e260433cb5c69be0dda440f.tar.gz |
Merge ^/head r278756 through r278915.
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/gen/dlopen.3 | 4 | ||||
-rw-r--r-- | lib/libc/gen/fstab.c | 2 | ||||
-rw-r--r-- | lib/libc/gen/getgrent.c | 2 | ||||
-rw-r--r-- | lib/libc/gen/getpwent.c | 2 | ||||
-rw-r--r-- | lib/libc/gen/ulimit.c | 12 | ||||
-rw-r--r-- | lib/libc/include/libc_private.h | 2 | ||||
-rw-r--r-- | lib/libc/sparc64/sys/Makefile.inc | 2 | ||||
-rw-r--r-- | lib/libc/sparc64/sys/sigaction1.S (renamed from lib/libc/sparc64/sys/sigaction.S) | 5 | ||||
-rw-r--r-- | lib/libc/sys/Makefile.inc | 8 |
9 files changed, 24 insertions, 15 deletions
diff --git a/lib/libc/gen/dlopen.3 b/lib/libc/gen/dlopen.3 index 089e631..1963528 100644 --- a/lib/libc/gen/dlopen.3 +++ b/lib/libc/gen/dlopen.3 @@ -32,7 +32,7 @@ .\" @(#) dlopen.3 1.6 90/01/31 SMI .\" $FreeBSD$ .\" -.Dd December 21, 2011 +.Dd February 14, 2015 .Dt DLOPEN 3 .Os .Sh NAME @@ -236,7 +236,7 @@ as follows, in the given order: The referencing object itself (or the object from which the call to .Fn dlsym is made), if that object was linked using the -.Fl Wsymbolic +.Fl Bsymbolic option to .Xr ld 1 . .It diff --git a/lib/libc/gen/fstab.c b/lib/libc/gen/fstab.c index 6a77abd..c21ceb3 100644 --- a/lib/libc/gen/fstab.c +++ b/lib/libc/gen/fstab.c @@ -181,7 +181,7 @@ fstabscan(void) if (cp != NULL) _fs_fstab.fs_passno = atoi(cp); } - strcpy(subline, _fs_fstab.fs_mntops); + (void)strlcpy(subline, _fs_fstab.fs_mntops, sizeof(subline)); p = subline; for (typexx = 0, cp = strsep(&p, ","); cp; cp = strsep(&p, ",")) { diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c index caa5ad5..4ba24ae 100644 --- a/lib/libc/gen/getgrent.c +++ b/lib/libc/gen/getgrent.c @@ -1450,7 +1450,7 @@ docompat: pos = ftello(st->fp); } fin: - if (!stayopen && st->fp != NULL) { + if (st->fp != NULL && !stayopen) { fclose(st->fp); st->fp = NULL; } diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c index 7cf7f47..6cd7eaf 100644 --- a/lib/libc/gen/getpwent.c +++ b/lib/libc/gen/getpwent.c @@ -815,7 +815,7 @@ files_passwd(void *retval, void *mdata, va_list ap) size_t bufsize, namesize; uid_t uid; uint32_t store; - int rv, stayopen, *errnop; + int rv, stayopen = 0, *errnop; name = NULL; uid = (uid_t)-1; diff --git a/lib/libc/gen/ulimit.c b/lib/libc/gen/ulimit.c index e1bc020..2c090c0 100644 --- a/lib/libc/gen/ulimit.c +++ b/lib/libc/gen/ulimit.c @@ -40,7 +40,7 @@ ulimit(int cmd, ...) { struct rlimit limit; va_list ap; - long arg; + rlim_t arg; if (cmd == UL_GETFSIZE) { if (getrlimit(RLIMIT_FSIZE, &limit) == -1) @@ -53,14 +53,16 @@ ulimit(int cmd, ...) va_start(ap, cmd); arg = va_arg(ap, long); va_end(ap); - limit.rlim_max = limit.rlim_cur = (rlim_t)arg * 512; + if (arg < 0) + arg = LONG_MAX; + if (arg > RLIM_INFINITY / 512) + arg = RLIM_INFINITY / 512; + limit.rlim_max = limit.rlim_cur = arg * 512; /* The setrlimit() function sets errno to EPERM if needed. */ if (setrlimit(RLIMIT_FSIZE, &limit) == -1) return (-1); - if (arg * 512 > LONG_MAX) - return (LONG_MAX); - return (arg); + return ((long)arg); } else { errno = EINVAL; return (-1); diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h index 71fc8df..e4bf4a6 100644 --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -271,7 +271,7 @@ void _malloc_first_thread(void); /* * Function to clean up streams, called from abort() and exit(). */ -void (*__cleanup)(void) __hidden; +extern void (*__cleanup)(void) __hidden; /* * Get kern.osreldate to detect ABI revisions. Explicitly diff --git a/lib/libc/sparc64/sys/Makefile.inc b/lib/libc/sparc64/sys/Makefile.inc index 031af19..726c0c9 100644 --- a/lib/libc/sparc64/sys/Makefile.inc +++ b/lib/libc/sparc64/sys/Makefile.inc @@ -12,7 +12,7 @@ SRCS+= __sparc_sigtramp_setup.c \ CFLAGS+= -I${LIBC_SRCTOP}/sparc64/fpu -MDASM+= brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S sigaction.S +MDASM+= brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S sigaction1.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o diff --git a/lib/libc/sparc64/sys/sigaction.S b/lib/libc/sparc64/sys/sigaction1.S index 7d32f97..219a238 100644 --- a/lib/libc/sparc64/sys/sigaction.S +++ b/lib/libc/sparc64/sys/sigaction1.S @@ -29,7 +29,8 @@ __FBSDID("$FreeBSD$"); #include "SYS.h" -_SYSENTRY(sigaction) + WEAK_REFERENCE(__sys_sigaction, _sigaction) +ENTRY(__sys_sigaction) PIC_PROLOGUE(%o3, %o4) SET(sigcode_installed, %o4, %o3) lduw [%o3], %o4 @@ -44,6 +45,6 @@ _SYSENTRY(sigaction) 1: _SYSCALL(sigaction) retl nop -_SYSEND(sigaction) +END(__sys_sigaction) .comm sigcode_installed, 4, 4 diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index e8ec58e..0edf644 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -65,7 +65,6 @@ INTERPOSED = \ sendmsg \ sendto \ setcontext \ - sigaction \ sigprocmask \ sigsuspend \ sigtimedwait \ @@ -76,6 +75,13 @@ INTERPOSED = \ write \ writev +.if ${MACHINE_CPUARCH} == "sparc64" +SRCS+= sigaction.c +NOASM+= sigaction.o +.else +INTERPOSED+= sigaction +.endif + SRCS+= ${INTERPOSED:S/$/.c/} NOASM+= ${INTERPOSED:S/$/.o/} PSEUDO+= ${INTERPOSED:C/^.*$/_&.o/} |