aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/csu/aarch64/crt1.c6
-rw-r--r--lib/libc/stdlib/tdelete.c1
-rw-r--r--lib/libc/string/wcslcat.c2
-rw-r--r--lib/libc/string/wcsncat.c2
-rw-r--r--lib/libc/sys/stat.27
-rw-r--r--lib/libdpv/dpv.c6
-rw-r--r--lib/libdpv/dpv.h3
-rw-r--r--lib/libthr/thread/thr_umtx.c5
8 files changed, 18 insertions, 14 deletions
diff --git a/lib/csu/aarch64/crt1.c b/lib/csu/aarch64/crt1.c
index ed24f4689ed3..40279b79853d 100644
--- a/lib/csu/aarch64/crt1.c
+++ b/lib/csu/aarch64/crt1.c
@@ -54,11 +54,7 @@ __asm(" .text \n"
" .align 0 \n"
" .globl _start \n"
" _start: \n"
-/* TODO: Remove this when the kernel correctly aligns the stack */
-" cbnz x0, 1f \n" /* Are we using a new kernel? */
-" mov x0, sp \n" /* No, load the args from sp */
-" and sp, x0, #~0xf \n" /* And align the stack */
-"1: mov x3, x2 \n" /* cleanup */
+" mov x3, x2 \n" /* cleanup */
" add x1, x0, #8 \n" /* load argv */
" ldr x0, [x0] \n" /* load argc */
" add x2, x1, x0, lsl #3 \n" /* env is after argv */
diff --git a/lib/libc/stdlib/tdelete.c b/lib/libc/stdlib/tdelete.c
index 7799f35cc1e7..ff63576a1bf5 100644
--- a/lib/libc/stdlib/tdelete.c
+++ b/lib/libc/stdlib/tdelete.c
@@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$");
base = leaf; \
path_init(&path); \
} \
- result = &(*leaf)->key; \
path_taking_right(&path); \
leaf = &(*leaf)->rlink; \
} while (0)
diff --git a/lib/libc/string/wcslcat.c b/lib/libc/string/wcslcat.c
index f5f1e1ee7559..2df94777d51f 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 44f1ff98980c..5a243477db5b 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/stat.2 b/lib/libc/sys/stat.2
index 5e49b3c0b992..3405d6e3511c 100644
--- a/lib/libc/sys/stat.2
+++ b/lib/libc/sys/stat.2
@@ -28,7 +28,7 @@
.\" @(#)stat.2 8.4 (Berkeley) 5/1/95
.\" $FreeBSD$
.\"
-.Dd June 2, 2012
+.Dd January 14, 2016
.Dt STAT 2
.Os
.Sh NAME
@@ -40,12 +40,11 @@
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
-.In sys/types.h
.In sys/stat.h
.Ft int
-.Fn stat "const char *path" "struct stat *sb"
+.Fn stat "const char * restrict path" "struct stat * restrict sb"
.Ft int
-.Fn lstat "const char *path" "struct stat *sb"
+.Fn lstat "const char * restrict path" "struct stat * restrict sb"
.Ft int
.Fn fstat "int fd" "struct stat *sb"
.Ft int
diff --git a/lib/libdpv/dpv.c b/lib/libdpv/dpv.c
index 6a03922ff9fd..d3506ca9d82d 100644
--- a/lib/libdpv/dpv.c
+++ b/lib/libdpv/dpv.c
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
#include <dialog.h>
#include <err.h>
#include <limits.h>
+#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -482,6 +483,11 @@ dpv(struct dpv_config *config, struct dpv_file_node *file_list)
/* Reads: label_size pbar_size pprompt aprompt dpv_nfiles */
/* Inits: dheight and dwidth */
+ /* Default localeconv(3) settings for dialog(3) status */
+ setlocale(LC_NUMERIC,
+ getenv("LC_ALL") == NULL && getenv("LC_NUMERIC") == NULL ?
+ LC_NUMERIC_DEFAULT : "");
+
if (!debug) {
/* Internally create the initial `--gauge' prompt text */
dprompt_recreate(file_list, (struct dpv_file_node *)NULL, 0);
diff --git a/lib/libdpv/dpv.h b/lib/libdpv/dpv.h
index dbcd59bd67c0..03768a7ced40 100644
--- a/lib/libdpv/dpv.h
+++ b/lib/libdpv/dpv.h
@@ -38,6 +38,9 @@
#define FALSE 0
#endif
+/* localeconv(3) */
+#define LC_NUMERIC_DEFAULT "en_US.ISO8859-1"
+
/* Data to process */
extern long long dpv_overall_read;
diff --git a/lib/libthr/thread/thr_umtx.c b/lib/libthr/thread/thr_umtx.c
index a61dab023f52..37e5df183eb8 100644
--- a/lib/libthr/thread/thr_umtx.c
+++ b/lib/libthr/thread/thr_umtx.c
@@ -42,7 +42,7 @@ int _umtx_op_err(void *obj, int op, u_long val, void *uaddr, void *uaddr2)
void
_thr_umutex_init(struct umutex *mtx)
{
- static struct umutex default_mtx = DEFAULT_UMUTEX;
+ static const struct umutex default_mtx = DEFAULT_UMUTEX;
*mtx = default_mtx;
}
@@ -50,7 +50,8 @@ _thr_umutex_init(struct umutex *mtx)
void
_thr_urwlock_init(struct urwlock *rwl)
{
- static struct urwlock default_rwl = DEFAULT_URWLOCK;
+ static const struct urwlock default_rwl = DEFAULT_URWLOCK;
+
*rwl = default_rwl;
}