aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-07-04 21:50:39 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-07-04 21:50:39 +0000
commit4cd9b24e478b38e4e497f3ab98e09d6a00a5390d (patch)
tree37590f5c697f4198fdddec33c58aefdef0a5f485 /usr.bin
parent1c3bbb013d1242432bd8d1f7821f987894214710 (diff)
parentaaa7cbfe1a437c726deff38c3903786d9249af6a (diff)
Notes
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ar/write.c26
-rw-r--r--usr.bin/calendar/calendars/calendar.computer2
-rw-r--r--usr.bin/kdump/kdump.c6
-rw-r--r--usr.bin/mkesdb/Makefile1
-rw-r--r--usr.bin/mkimg/gpt.c2
-rw-r--r--usr.bin/mkimg/mbr.c1
-rw-r--r--usr.bin/mkimg/scheme.c1
-rw-r--r--usr.bin/mkimg/scheme.h1
-rw-r--r--usr.bin/netstat/ipsec.c3
-rw-r--r--usr.bin/units/units.c27
-rw-r--r--usr.bin/xinstall/xinstall.c8
11 files changed, 60 insertions, 18 deletions
diff --git a/usr.bin/ar/write.c b/usr.bin/ar/write.c
index 9ce18069487a..10b912ec2b1a 100644
--- a/usr.bin/ar/write.c
+++ b/usr.bin/ar/write.c
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#include <string.h>
#include <sysexits.h>
+#include <unistd.h>
#include "ar.h"
@@ -61,6 +62,7 @@ static void create_symtab_entry(struct bsdar *bsdar, void *maddr,
static void free_obj(struct bsdar *bsdar, struct ar_obj *obj);
static void insert_obj(struct bsdar *bsdar, struct ar_obj *obj,
struct ar_obj *pos);
+static void prefault_buffer(const char *buf, size_t s);
static void read_objs(struct bsdar *bsdar, const char *archive,
int checkargv);
static void write_archive(struct bsdar *bsdar, char mode);
@@ -551,11 +553,35 @@ write_cleanup(struct bsdar *bsdar)
}
/*
+ * Fault in the buffer prior to writing as a workaround for poor performance
+ * due to interaction with kernel fs deadlock avoidance code. See the comment
+ * above vn_io_fault_doio() in sys/kern/vfs_vnops.c for details of the issue.
+ */
+static void
+prefault_buffer(const char *buf, size_t s)
+{
+ volatile const char *p;
+ size_t page_size;
+
+ if (s == 0)
+ return;
+ page_size = sysconf(_SC_PAGESIZE);
+ for (p = buf; p < buf + s; p += page_size)
+ *p;
+ /*
+ * Ensure we touch the last page as well, in case the buffer is not
+ * page-aligned.
+ */
+ *(volatile const char *)(buf + s - 1);
+}
+
+/*
* Wrapper for archive_write_data().
*/
static void
write_data(struct bsdar *bsdar, struct archive *a, const void *buf, size_t s)
{
+ prefault_buffer(buf, s);
if (archive_write_data(a, buf, s) != (ssize_t)s)
bsdar_errc(bsdar, EX_SOFTWARE, 0, "%s",
archive_error_string(a));
diff --git a/usr.bin/calendar/calendars/calendar.computer b/usr.bin/calendar/calendars/calendar.computer
index e8b22b482a19..8d6176e25f38 100644
--- a/usr.bin/calendar/calendars/calendar.computer
+++ b/usr.bin/calendar/calendars/calendar.computer
@@ -69,7 +69,7 @@
10/14 British Computer Society founded, 1957
10/15 First FORTRAN Programmer's Reference Manual published, 1956
10/20 Zurich ALGOL report published, 1958
-10/25 DEC announces VAX-11/780
+10/25 DEC announces VAX-11/780, 1977
11/04 UNIVAC I program predicts Eisenhower victory based on 7% of votes, 1952
12/08 First Ph.D. awarded by Computer Science Dept, Univ. of Penna, 1965
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c
index 2f6c1e7cb6ce..d8b6ccd1298c 100644
--- a/usr.bin/kdump/kdump.c
+++ b/usr.bin/kdump/kdump.c
@@ -61,6 +61,9 @@ extern int errno;
#include <sys/un.h>
#include <sys/queue.h>
#include <sys/wait.h>
+#ifdef HAVE_LIBCAPSICUM
+#include <sys/nv.h>
+#endif
#include <arpa/inet.h>
#include <netinet/in.h>
#include <ctype.h>
@@ -77,9 +80,6 @@ extern int errno;
#include <locale.h>
#include <netdb.h>
#include <nl_types.h>
-#ifdef HAVE_LIBCAPSICUM
-#include <nv.h>
-#endif
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.bin/mkesdb/Makefile b/usr.bin/mkesdb/Makefile
index 69aed655810a..b9495edf7d84 100644
--- a/usr.bin/mkesdb/Makefile
+++ b/usr.bin/mkesdb/Makefile
@@ -3,7 +3,6 @@
.PATH: ${.CURDIR}/../../lib/libc/iconv
PROG= mkesdb
-LDFLAGS+= -L${.OBJDIR}/../../lib/libc
NO_WMISSING_VARIABLE_DECLARATIONS=
diff --git a/usr.bin/mkimg/gpt.c b/usr.bin/mkimg/gpt.c
index 5773a6a612f7..678e63653760 100644
--- a/usr.bin/mkimg/gpt.c
+++ b/usr.bin/mkimg/gpt.c
@@ -57,6 +57,7 @@ static uuid_t gpt_uuid_freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS;
static uuid_t gpt_uuid_freebsd_vinum = GPT_ENT_TYPE_FREEBSD_VINUM;
static uuid_t gpt_uuid_freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS;
static uuid_t gpt_uuid_mbr = GPT_ENT_TYPE_MBR;
+static uuid_t gpt_uuid_ms_basic_data = GPT_ENT_TYPE_MS_BASIC_DATA;
static struct mkimg_alias gpt_aliases[] = {
{ ALIAS_EFI, ALIAS_PTR2TYPE(&gpt_uuid_efi) },
@@ -68,6 +69,7 @@ static struct mkimg_alias gpt_aliases[] = {
{ ALIAS_FREEBSD_VINUM, ALIAS_PTR2TYPE(&gpt_uuid_freebsd_vinum) },
{ ALIAS_FREEBSD_ZFS, ALIAS_PTR2TYPE(&gpt_uuid_freebsd_zfs) },
{ ALIAS_MBR, ALIAS_PTR2TYPE(&gpt_uuid_mbr) },
+ { ALIAS_NTFS, ALIAS_PTR2TYPE(&gpt_uuid_ms_basic_data) },
{ ALIAS_NONE, 0 } /* Keep last! */
};
diff --git a/usr.bin/mkimg/mbr.c b/usr.bin/mkimg/mbr.c
index 9d737a574861..961ca45b45eb 100644
--- a/usr.bin/mkimg/mbr.c
+++ b/usr.bin/mkimg/mbr.c
@@ -51,6 +51,7 @@ static struct mkimg_alias mbr_aliases[] = {
{ ALIAS_EFI, ALIAS_INT2TYPE(DOSPTYP_EFI) },
{ ALIAS_FAT32, ALIAS_INT2TYPE(DOSPTYP_FAT32) },
{ ALIAS_FREEBSD, ALIAS_INT2TYPE(DOSPTYP_386BSD) },
+ { ALIAS_NTFS, ALIAS_INT2TYPE(DOSPTYP_NTFS) },
{ ALIAS_NONE, 0 } /* Keep last! */
};
diff --git a/usr.bin/mkimg/scheme.c b/usr.bin/mkimg/scheme.c
index 336f953c8b6c..9bdf8a5a5463 100644
--- a/usr.bin/mkimg/scheme.c
+++ b/usr.bin/mkimg/scheme.c
@@ -59,6 +59,7 @@ static struct {
{ "freebsd-vinum", ALIAS_FREEBSD_VINUM },
{ "freebsd-zfs", ALIAS_FREEBSD_ZFS },
{ "mbr", ALIAS_MBR },
+ { "ntfs", ALIAS_NTFS },
{ NULL, ALIAS_NONE } /* Keep last! */
};
diff --git a/usr.bin/mkimg/scheme.h b/usr.bin/mkimg/scheme.h
index d594a1917d67..73b06eb7a4fb 100644
--- a/usr.bin/mkimg/scheme.h
+++ b/usr.bin/mkimg/scheme.h
@@ -45,6 +45,7 @@ enum alias {
ALIAS_FREEBSD_VINUM,
ALIAS_FREEBSD_ZFS,
ALIAS_MBR,
+ ALIAS_NTFS,
/* end */
ALIAS_COUNT /* Keep last! */
};
diff --git a/usr.bin/netstat/ipsec.c b/usr.bin/netstat/ipsec.c
index 137a26c39c23..f3309ff13fa6 100644
--- a/usr.bin/netstat/ipsec.c
+++ b/usr.bin/netstat/ipsec.c
@@ -157,6 +157,9 @@ static struct val2str ipsec_espnames[] = {
#ifdef SADB_X_EALG_AESCTR
{ SADB_X_EALG_AESCTR, "aes-ctr", },
#endif
+#ifdef SADB_X_EALG_AESGCM16
+ { SADB_X_EALG_AESGCM16, "aes-gcm-16", },
+#endif
{ -1, NULL },
};
diff --git a/usr.bin/units/units.c b/usr.bin/units/units.c
index 3d39d0e98131..929510f5663f 100644
--- a/usr.bin/units/units.c
+++ b/usr.bin/units/units.c
@@ -802,17 +802,6 @@ main(int argc, char **argv)
if (!readfile)
readunits(NULL);
- inhistory = history_init();
- el = el_init(argv[0], stdin, stdout, stderr);
- el_set(el, EL_PROMPT, &prompt);
- el_set(el, EL_EDITOR, "emacs");
- el_set(el, EL_SIGNAL, 1);
- el_set(el, EL_HIST, history, inhistory);
- el_source(el, NULL);
- history(inhistory, &ev, H_SETSIZE, 800);
- if (inhistory == 0)
- err(1, "Could not initialize history");
-
if (cap_enter() < 0 && errno != ENOSYS)
err(1, "unable to enter capability mode");
@@ -828,6 +817,17 @@ main(int argc, char **argv)
showanswer(&have, &want);
}
else {
+ inhistory = history_init();
+ el = el_init(argv[0], stdin, stdout, stderr);
+ el_set(el, EL_PROMPT, &prompt);
+ el_set(el, EL_EDITOR, "emacs");
+ el_set(el, EL_SIGNAL, 1);
+ el_set(el, EL_HIST, history, inhistory);
+ el_source(el, NULL);
+ history(inhistory, &ev, H_SETSIZE, 800);
+ if (inhistory == 0)
+ err(1, "Could not initialize history");
+
if (!quiet)
printf("%d units, %d prefixes\n", unitcount,
prefixcount);
@@ -858,9 +858,10 @@ main(int argc, char **argv)
completereduce(&want));
showanswer(&have, &want);
}
+
+ history_end(inhistory);
+ el_end(el);
}
- history_end(inhistory);
- el_end(el);
return (0);
}
diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c
index b59db70bf99d..33e818a907ee 100644
--- a/usr.bin/xinstall/xinstall.c
+++ b/usr.bin/xinstall/xinstall.c
@@ -658,6 +658,14 @@ makelink(const char *from_name, const char *to_name,
if (dolink & LN_RELATIVE) {
char *cp, *d, *s;
+ if (*from_name != '/') {
+ /* this is already a relative link */
+ do_symlink(from_name, to_name, target_sb);
+ /* XXX: from_name may point outside of destdir. */
+ metadata_log(to_name, "link", NULL, from_name, NULL, 0);
+ return;
+ }
+
/* Resolve pathnames. */
if (realpath(from_name, src) == NULL)
err(EX_OSERR, "%s: realpath", from_name);