summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-01-25 08:56:15 -0200
committerRenato Botelho <renato@netgate.com>2016-01-25 08:56:15 -0200
commiteb84e0723f3b4bc5e40024f66fe21c14b09e9ec4 (patch)
treefec6b99d018e13f1fccbe31478aaf29a28a55642 /lib/libc
parentc50df8e1b90c4f9b8bbffa592477c129854776ce (diff)
parent94b1bbbd44bd88b6db1c00d795cdf7675b3ae254 (diff)
downloadFreeBSD-src-eb84e0723f3b4bc5e40024f66fe21c14b09e9ec4.zip
FreeBSD-src-eb84e0723f3b4bc5e40024f66fe21c14b09e9ec4.tar.gz
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/net/if_nametoindex.c2
-rw-r--r--lib/libc/rpc/rpc_soc.c2
-rw-r--r--lib/libc/rpc/rpcb_clnt.c4
-rw-r--r--lib/libc/rpc/rpcb_prot.c4
-rw-r--r--lib/libc/string/wcslcat.c2
-rw-r--r--lib/libc/string/wcsncat.c2
-rw-r--r--lib/libc/sys/futimens.c5
-rw-r--r--lib/libc/sys/utimensat.211
-rw-r--r--lib/libc/sys/utimensat.c5
-rw-r--r--lib/libc/tests/net/Makefile2
10 files changed, 24 insertions, 15 deletions
diff --git a/lib/libc/net/if_nametoindex.c b/lib/libc/net/if_nametoindex.c
index 8f04921..debf3fa 100644
--- a/lib/libc/net/if_nametoindex.c
+++ b/lib/libc/net/if_nametoindex.c
@@ -70,9 +70,7 @@ if_nametoindex(const char *ifname)
s = _socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0);
if (s != -1) {
-#ifdef PURIFY
memset(&ifr, 0, sizeof(ifr));
-#endif
strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
if (_ioctl(s, SIOCGIFINDEX, &ifr) != -1) {
_close(s);
diff --git a/lib/libc/rpc/rpc_soc.c b/lib/libc/rpc/rpc_soc.c
index 8d0f34e..ff7a289 100644
--- a/lib/libc/rpc/rpc_soc.c
+++ b/lib/libc/rpc/rpc_soc.c
@@ -525,7 +525,7 @@ svcunix_create(sock, sendsize, recvsize, path)
break;
}
if (nconf == NULL)
- return(xprt);
+ goto done;
if ((sock = __rpc_nconf2fd(nconf)) < 0)
goto done;
diff --git a/lib/libc/rpc/rpcb_clnt.c b/lib/libc/rpc/rpcb_clnt.c
index 943d7c8..117ee0f 100644
--- a/lib/libc/rpc/rpcb_clnt.c
+++ b/lib/libc/rpc/rpcb_clnt.c
@@ -675,11 +675,11 @@ __rpcbind_is_up()
strcmp(nconf->nc_protofmly, NC_LOOPBACK) == 0)
break;
}
+ endnetconfig(localhandle);
+
if (nconf == NULL)
return (FALSE);
- endnetconfig(localhandle);
-
memset(&sun, 0, sizeof sun);
sock = _socket(AF_LOCAL, SOCK_STREAM, 0);
if (sock < 0)
diff --git a/lib/libc/rpc/rpcb_prot.c b/lib/libc/rpc/rpcb_prot.c
index f543aaf..92463c0 100644
--- a/lib/libc/rpc/rpcb_prot.c
+++ b/lib/libc/rpc/rpcb_prot.c
@@ -217,14 +217,14 @@ xdr_rpcb_entry_list_ptr(xdrs, rp)
* the case of freeing we must remember the next object
* before we free the current object ...
*/
- if (freeing)
+ if (freeing && *rp)
next = (*rp)->rpcb_entry_next;
if (! xdr_reference(xdrs, (caddr_t *)rp,
(u_int)sizeof (rpcb_entry_list),
(xdrproc_t)xdr_rpcb_entry)) {
return (FALSE);
}
- if (freeing && *rp) {
+ if (freeing) {
next_copy = next;
rp = &next_copy;
/*
diff --git a/lib/libc/string/wcslcat.c b/lib/libc/string/wcslcat.c
index f5f1e1e..2df9477 100644
--- a/lib/libc/string/wcslcat.c
+++ b/lib/libc/string/wcslcat.c
@@ -54,7 +54,7 @@ wcslcat(wchar_t *dst, const wchar_t *src, size_t siz)
size_t dlen;
/* Find the end of dst and adjust bytes left but don't go past end */
- while (*d != '\0' && n-- != 0)
+ while (n-- != 0 && *d != '\0')
d++;
dlen = d - dst;
n = siz - dlen;
diff --git a/lib/libc/string/wcsncat.c b/lib/libc/string/wcsncat.c
index 44f1ff9..5a24347 100644
--- a/lib/libc/string/wcsncat.c
+++ b/lib/libc/string/wcsncat.c
@@ -48,7 +48,7 @@ wcsncat(wchar_t * __restrict s1, const wchar_t * __restrict s2, size_t n)
p++;
q = p;
r = s2;
- while (*r && n) {
+ while (n && *r) {
*q++ = *r++;
n--;
}
diff --git a/lib/libc/sys/futimens.c b/lib/libc/sys/futimens.c
index 2014cc5..59fb37f 100644
--- a/lib/libc/sys/futimens.c
+++ b/lib/libc/sys/futimens.c
@@ -42,8 +42,11 @@ futimens(int fd, const struct timespec times[2])
{
struct timeval now, tv[2], *tvp;
struct stat sb;
+ int osreldate;
- if (__getosreldate() >= 1100056)
+ osreldate = __getosreldate();
+ if (osreldate >= 1100056 ||
+ (osreldate >= 1002506 && osreldate < 1100000))
return (__sys_futimens(fd, times));
if (times == NULL || (times[0].tv_nsec == UTIME_NOW &&
diff --git a/lib/libc/sys/utimensat.2 b/lib/libc/sys/utimensat.2
index 0f397c6..a714b34 100644
--- a/lib/libc/sys/utimensat.2
+++ b/lib/libc/sys/utimensat.2
@@ -31,7 +31,7 @@
.\" @(#)utimes.2 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd January 23, 2015
+.Dd January 17, 2016
.Dt UTIMENSAT 2
.Os
.Sh NAME
@@ -183,10 +183,13 @@ argument
points outside the process's allocated address space.
.It Bq Er EINVAL
The
-.Va tv_usec
+.Va tv_nsec
component of at least one of the values specified by the
.Fa times
-argument has a value less than 0 or greater than 999999.
+argument has a value less than 0 or greater than 999999999 and is not equal to
+.Dv UTIME_NOW
+or
+.Dv UTIME_OMIT .
.It Bq Er EIO
An I/O error occurred while reading or writing the affected inode.
.It Bq Er EPERM
@@ -289,4 +292,4 @@ The
and
.Fn utimensat
system calls appeared in
-.Fx 11.0 .
+.Fx 10.3 .
diff --git a/lib/libc/sys/utimensat.c b/lib/libc/sys/utimensat.c
index 67d19cb..a1c3c21 100644
--- a/lib/libc/sys/utimensat.c
+++ b/lib/libc/sys/utimensat.c
@@ -42,8 +42,11 @@ utimensat(int fd, const char *path, const struct timespec times[2], int flag)
{
struct timeval now, tv[2], *tvp;
struct stat sb;
+ int osreldate;
- if (__getosreldate() >= 1100056)
+ osreldate = __getosreldate();
+ if (osreldate >= 1100056 ||
+ (osreldate >= 1002506 && osreldate < 1100000))
return (__sys_utimensat(fd, path, times, flag));
if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0) {
diff --git a/lib/libc/tests/net/Makefile b/lib/libc/tests/net/Makefile
index a88f44f..fb76f26 100644
--- a/lib/libc/tests/net/Makefile
+++ b/lib/libc/tests/net/Makefile
@@ -28,6 +28,8 @@ PROGS+= h_dns_server
DPADD.h_nsd_recurse+= ${LIBPTHREAD}
LDADD.h_nsd_recurse+= -lpthread
+__MAKE_SHELL?= /bin/sh
+
CLEANFILES+= aton_ether_subr.c
aton_ether_subr.c: gen_ether_subr ${.CURDIR:H:H:H:H}/sys/net/if_ethersubr.c
${__MAKE_SHELL} ${.ALLSRC} ${.TARGET}
OpenPOWER on IntegriCloud