Antonio Huete Jimenez [Sun, 28 Jan 2018 19:58:28 +0000 (20:58 +0100)]
newsyslog - Signal result checking unneeded
We don't need to check the result of sending signal when -R option is
specified.
Obtained-from: FreeBSD (r238281)
Antonio Huete Jimenez [Sun, 28 Jan 2018 18:57:10 +0000 (19:57 +0100)]
newsyslog - Oversize checks.
Don't run through time checks when entry is definitely oversized. This
leads to newsyslog rotating on (size OR time) if both are specified.
Obtained-from: FreeBSD (r233257)
Antonio Huete Jimenez [Sun, 28 Jan 2018 18:38:17 +0000 (19:38 +0100)]
newsyslog - Add new modifier - "R"
When it is specified the path to pid file will be considered as a
path to a binary or a shell script to be executed after rotation
has been completed instead of sending signal to the process
id in that file.
Obtained-from: FreeBSD (r221873)
Antonio Huete Jimenez [Sun, 28 Jan 2018 18:21:48 +0000 (19:21 +0100)]
newsyslog - Fix an old bug in newsyslog
We kept one log file more than was requested in newsyslog.conf.
This was only the case using the non-time based filenames (.0, .1,
.2 etc.).
The change also makes newsyslog clean clean up the old extra logfile
so users don't end up with a single stale logfile which won't be
rotated out.
This change also cleans up some code a bit to avoid more copy / paste
code and removes some old copy / paste code in the process.
Obtained-from: FreeBSD (r220926)
Antonio Huete Jimenez [Sun, 28 Jan 2018 17:49:20 +0000 (18:49 +0100)]
newsyslog - Sync manpage's SYNOPSIS with program's usage
Obtained-from: FreeBSD (219434)
Antonio Huete Jimenez [Sun, 28 Jan 2018 17:36:27 +0000 (18:36 +0100)]
newsyslog - Make code more friendly to the non-C99 compilers
Obtained-from: FreeBSD (r218944)
zrj [Sun, 28 Jan 2018 19:42:32 +0000 (21:42 +0200)]
catman(1): Suppress few warnings.
zrj [Sun, 28 Jan 2018 19:00:37 +0000 (21:00 +0200)]
bsd.sys.mk: Implement WARNS_AUDIT option.
The buildworld is expected not to pass this mode, so make(1) should
be invoked with '-k'. Strictly just as convenience for developers.
This is similar to FORMAT_AUDIT, for extra diagnostics by compiler at a
given WARNS level. The -Wall and -Wextra are getting bit too crowded.
While there, document FORMAT_AUDIT too.
In-discussion-with: swildner
Sascha Wildner [Sun, 28 Jan 2018 17:44:12 +0000 (18:44 +0100)]
Remove an unused variable in various Makefile.inc's.
zrj [Sun, 28 Jan 2018 17:08:25 +0000 (19:08 +0200)]
games: Add FALLTHROUGH where missing.
zrj [Sun, 28 Jan 2018 17:03:17 +0000 (19:03 +0200)]
tetris(6): Fix -Wformat-truncation warning.
Also make use of macro instead of relying on magic numbers for keys.
While there, do a similar thing in sail(6).
zrj [Sun, 28 Jan 2018 17:02:01 +0000 (19:02 +0200)]
rogue(6): General cleanup.
* Move externs to common rogue.h
* Constify
* Various cleanups
* Several bugfixes from NetBSD
zrj [Sun, 28 Jan 2018 16:57:53 +0000 (18:57 +0200)]
phantasia(6): General cleanup.
* Staticize
* Constify
* Collect externs
* Add attributes
* Sync logic with NetBSD (except for style)
zrj [Sun, 28 Jan 2018 16:54:57 +0000 (18:54 +0200)]
hack(6): Suppress warnings.
Add FALLTHROUGH directives were needed, fix few format issues.
Imre Vadász [Sun, 28 Jan 2018 15:11:10 +0000 (16:11 +0100)]
syscons - Untangle device attachement from isa?, attach to nexus? instead.
* The syscons device was still attaching via the isa? bus for mostly
historical reasons. Instead directly attach to nexus? and use a custom
_identify method to create the sc%d child devices.
Imre Vadász [Sun, 21 Jan 2018 16:48:53 +0000 (17:48 +0100)]
led(4): Turn this into a module. Only used by acpi_thinkpad and acpi_asus.
zrj [Sun, 28 Jan 2018 15:12:08 +0000 (17:12 +0200)]
games: Do not override default CFLAGS.
Preserve system default CFLAGS. Override is only needed in case of boot2.
zrj [Sun, 28 Jan 2018 14:44:03 +0000 (16:44 +0200)]
libfetch: Suppress fallthrough warning.
Eitan Adler [Sun, 28 Jan 2018 05:34:46 +0000 (21:34 -0800)]
Prefer https over http in commit template
Eitan Adler [Sun, 28 Jan 2018 05:33:16 +0000 (21:33 -0800)]
Shifting into or out of an int's sign bit is undefined, and this loop
deterministically and intentionally does both.
Dragonfly-bug: https://bugs.dragonflybsd.org/issues/3112
Submitted-by: "mmcc"
Sascha Wildner [Sat, 27 Jan 2018 10:14:56 +0000 (11:14 +0100)]
bus_dma.9: Add a few lines about bus_dmamap_load_ccb().
While doing, add a comment to the function.
Sascha Wildner [Fri, 26 Jan 2018 22:07:34 +0000 (23:07 +0100)]
<sys/cdefs.h>: Add __alloc_size2() for functions taking number and size.
Add it to calloc().
Pointed-out-by: zrj
Sascha Wildner [Fri, 26 Jan 2018 17:20:15 +0000 (18:20 +0100)]
<sys/cdefs.h>: Make __nonnull variadic.
Make use of it in the remaining __nonnull decorations we have.
Sascha Wildner [Fri, 26 Jan 2018 17:16:50 +0000 (18:16 +0100)]
lvm(8): Add line editing support (libedit is already linked).
zrj [Fri, 26 Jan 2018 12:37:37 +0000 (14:37 +0200)]
libedit: Check dereferenced pointer for NULL.
Already fixed in NetBSD.
Caught-by: gcc80 -Wpointer-compare
Sascha Wildner [Wed, 24 Jan 2018 18:00:19 +0000 (19:00 +0100)]
Fix two more gcc80 -Wsizeof-pointer-memaccess warnings.
zrj [Wed, 24 Jan 2018 16:07:37 +0000 (18:07 +0200)]
pppctl(8): Avoid overlapping strcpy() copies.
Use intermediate.
zrj [Wed, 24 Jan 2018 15:34:34 +0000 (17:34 +0200)]
telnet(1): Avoid overlapping strncpy() copies.
The cmdrc() is shifting string to the left, use temporary.
While there, do some constification.
zrj [Wed, 24 Jan 2018 14:07:16 +0000 (16:07 +0200)]
pax(1): Honour the restrict in sigaction().
Use a setup_sig() helper and make it fail when either of sigaction fails.
While there, do not leak fds for "." + minor cleanup.
Taken-from: OpenBSD
zrj [Wed, 24 Jan 2018 13:47:40 +0000 (15:47 +0200)]
dd(1): Use a local swapbytes() function.
The swab(3) has restrict qualifiers for src and dst.
Avoid relying on undefined overlapping swab behavior.
Taken-from: OpenBSD
zrj [Wed, 24 Jan 2018 12:33:56 +0000 (14:33 +0200)]
mille(6): General cleanup.
* Constification.
* Braces.
* Do not use increments/decrements on booleans.
* Add few missing fallthrough.
zrj [Wed, 24 Jan 2018 08:48:08 +0000 (10:48 +0200)]
pf: Fix bzero() argument.
Intention here is to zero out the local pfioc_trans structure and not the
char *t puinter.
Caught-by: gcc80 -Wstringop-overflow
zrj [Wed, 24 Jan 2018 08:25:59 +0000 (10:25 +0200)]
ktrdump(8): Fix bzero() argument on error.
Intention here is to zero out the struct and not the local pointer,
based on change in
e7c0dbbaa.
Caught-by: gcc80 -Wstringop-overflow
zrj [Wed, 24 Jan 2018 07:57:06 +0000 (09:57 +0200)]
vinum(8): Allow for terminating NULL.
Mainly to suppress -Wstringop-overflow warning.
zrj [Wed, 24 Jan 2018 07:42:17 +0000 (09:42 +0200)]
cvs(1): Avoid -Wstringop-overflow warning.
The cvs will terminate after calling it's error(1, ...) but it can not be
marked as noreturn. So just add a hint for compiler that memcmp() with
read1 == -1 as an argument is not reachable.
Sascha Wildner [Wed, 24 Jan 2018 08:32:42 +0000 (09:32 +0100)]
Fix gcc80 -Wbool-operation warnings in fortune(6) and hack(6).
Sascha Wildner [Wed, 24 Jan 2018 08:26:05 +0000 (09:26 +0100)]
Fix a number of gcc80 -Wsizeof-pointer-memaccess warnings.
The file is reused in various utilities.
However, the mid- to long-term plan is to remove legacy utmp code and
only go with standard utmpx.
Sascha Wildner [Tue, 23 Jan 2018 20:19:57 +0000 (21:19 +0100)]
gnu/lib: Raise WARNS generally to 1 via Makefile.inc.
zrj [Tue, 23 Jan 2018 18:19:13 +0000 (20:19 +0200)]
libm: Avoid left-shifting negative integers.
It is undefined behaviour.
Taken-from: OpenBSD
zrj [Tue, 23 Jan 2018 18:11:47 +0000 (20:11 +0200)]
ipfw: Avoid left-shifting negative integers.
It is undefined behaviour.
While there, mark one fallthrough case.
zrj [Tue, 23 Jan 2018 17:48:45 +0000 (19:48 +0200)]
games: Fix -Wint-in-bool-context warnings.
These cases were the last two in base.
zrj [Tue, 23 Jan 2018 16:20:21 +0000 (18:20 +0200)]
binutils227: Fix comparison of pointer against char.
Backport from upstream.
zrj [Tue, 23 Jan 2018 16:19:44 +0000 (18:19 +0200)]
binutils225: Fix comparison of pointer against char.
Backport from upstream.
While there, deal with -Wshift-overflow in aarch64.cc (unused).
zrj [Tue, 23 Jan 2018 16:19:10 +0000 (18:19 +0200)]
gdb: Fix wrong comparison of pointer against char.
Backport from upstream.
Sascha Wildner [Tue, 23 Jan 2018 10:40:29 +0000 (11:40 +0100)]
Oops, fix up my previous commit properly.
Sascha Wildner [Tue, 23 Jan 2018 09:13:06 +0000 (10:13 +0100)]
Fix gcc80 -Wmultistatement-macros.
Sascha Wildner [Tue, 23 Jan 2018 08:01:40 +0000 (09:01 +0100)]
gcc50/Makefile.inc: Add newline at EOF.
Markus Pfeiffer [Mon, 22 Jan 2018 20:27:13 +0000 (20:27 +0000)]
Revert "terminfo: Add xterm-termite to Makefile.entries"
This reverts commit
5f4713d27c03fbf254d1d7e9939f9864261337b6.
Sascha Wildner [Mon, 22 Jan 2018 17:47:48 +0000 (18:47 +0100)]
gnu/sbin: Raise WARNS generally to 1 via Makefile.inc.
Sascha Wildner [Mon, 22 Jan 2018 16:50:40 +0000 (17:50 +0100)]
gcc50/libgcov: Fix whitespace in Makefile.
zrj [Mon, 22 Jan 2018 16:23:09 +0000 (18:23 +0200)]
Revert "kernel: Disable attributes that take no effect."
This reverts commit
191430ddf0486f992e75ff14effbb5a69e1da2bd.
Needs more checking.
Tomohiro Kusumi [Mon, 22 Jan 2018 15:29:46 +0000 (17:29 +0200)]
sbin/mount_autofs: Add description
TL;DR users won't be running this command to mount autofs.
Having autofs_enable=YES won't run this command either.
There is a high level command automount(8) and that does everything
based on /etc/auto_master contents.
mount_autofs(8) is a low level version where users can manually
specify things automount(8) internally passes to mount(2).
Thus it's not easy or needed to understand what -fOp options exactly
do without having clear understanding of autofs internal.
But I'll write it here in case interested.
-f is a string which eventually gets copied to statfs::f_mntfromname.
Unlike most of the filesystems with backing store, this is just
a label to identify the autofs mount.
-O is mount options of autofs(5).
-p is a prefix string to distinct direct and indirect mapping.
Sascha Wildner [Mon, 22 Jan 2018 12:59:27 +0000 (13:59 +0100)]
Fix some -Wunused-const-variable warnings and a -Wmisleading-indentation.
Sascha Wildner [Mon, 22 Jan 2018 12:44:12 +0000 (13:44 +0100)]
dconschat(8): Put the fflush() under 'verbose' too.
Sascha Wildner [Mon, 22 Jan 2018 12:37:19 +0000 (13:37 +0100)]
dconschat(8): Fix -Wmisleading-indentation.
Sascha Wildner [Mon, 22 Jan 2018 12:31:51 +0000 (13:31 +0100)]
Fix one last -Wnonnull-compare in m4(1).
Sascha Wildner [Mon, 22 Jan 2018 12:26:58 +0000 (13:26 +0100)]
Fix gcc80 -Wnonnull-compare.
For arguments that are checked against NULL in the function, we don't
want a nonnull attribute, because that will cause the NULL check to be
optimized away in higher -O levels and it will also trigger a
-Wnonnull-compare warning.
See also
0f037c78525bfb7df49de8338826e15137859b1d commit message.
Sascha Wildner [Sun, 21 Jan 2018 21:13:30 +0000 (22:13 +0100)]
lib/i18n_module: Add a missing break.
It is intended and correct, but has no correctness implications due
to is94 => is96.
Confirmed-by: cem@freebsd, eadler@freebsd
Sascha Wildner [Sun, 21 Jan 2018 21:03:35 +0000 (22:03 +0100)]
rcs: Fix gcc80 warnings (-Wdangling-else and -Wmisleading-indentation).
zrj [Sun, 21 Jan 2018 18:37:20 +0000 (20:37 +0200)]
hammer2: Remove duplicate initialialization of fields.
Avoids -Woverride-init diagnostics.
While there, minor whitespace cleanup.
zrj [Sun, 21 Jan 2018 18:31:01 +0000 (20:31 +0200)]
kernel: Disable few nonnull attributes.
To avoid -Wnonnull-compare, similarly as in:
0f037c78525bfb7df49de8338826e15137859b1d
devfs_core.c: devfs_find_device_by_name()
1st arg checked (NULL == return)
kern_slaballoc.c: kfree()
1st arg checked (NULL == panic)
2nd arg not checked
kern_synch.c: tsleep()
1st arg checked (NULL == KASSERT)
subr_prf.c: kvcprintf()
1st arg checked (NULL == "(fmt null)")
subr_sbuf.c: sbuf_vprintf()
2nd arg checked (NULL == KASSERT)
zrj [Sun, 21 Jan 2018 15:56:58 +0000 (17:56 +0200)]
kernel/bus: Avoid panic on NULL passed to kfree().
Our kfree() will issue panic() on NULL pointer.
Caught-by: gcc80 -Wnonnull
zrj [Sun, 21 Jan 2018 15:32:21 +0000 (17:32 +0200)]
kernel/ipsec: Avoid -Warray-bounds warning.
Just panic if something else than 0, 1 or 2 is passed.
zrj [Sun, 21 Jan 2018 15:02:22 +0000 (17:02 +0200)]
kernel/ipsec: Fix useless m_pkthdr.len check.
Compare it against sadb_msg.
Caught-by: gcc80 -Wtautological-compare
zrj [Sun, 21 Jan 2018 14:34:47 +0000 (16:34 +0200)]
ig_hal: Reindent e1000_ich8lan.c a bit.
No functional change.
zrj [Sun, 21 Jan 2018 14:15:34 +0000 (16:15 +0200)]
ipfw3_nat: Reindent switch cases.
No functional change.
While there, make add_redir_spool_cfg() and del_redir_spool_cfg() static.
zrj [Sun, 21 Jan 2018 12:46:14 +0000 (14:46 +0200)]
kernel: Disable attributes that take no effect.
Both gcc50 and gcc80 ignore these attributes:
warning: ignoring attribute 'aligned' because it conflicts with attribute 'packed' [-Wattributes]
No differences for final objects.
zrj [Sun, 21 Jan 2018 11:42:15 +0000 (13:42 +0200)]
netgraph: Disable unused structs.
This needs recheck.
While there, document that musycc and if_mn requires netgraph and
are not compatible with netgraph7.
Tomohiro Kusumi [Sun, 21 Jan 2018 17:49:56 +0000 (19:49 +0200)]
usr.sbin/autofs: Drop unneeded header include
common.c has no dependency on autofs api itself.
Sascha Wildner [Sun, 21 Jan 2018 11:02:04 +0000 (12:02 +0100)]
Sync zoneinfo database with tzdata2018b from ftp://ftp.iana.org/tz/releases
* Sao Tome and Principe switched from +00 to +01.
* Brazil's DST will now start on November's first Sunday.
* A discrepancy of 4 s in timestamps before 1931 in South Sudan has
been corrected.
* The abbreviation invented for Bolivia Summer Time (1931-2) is now
BST instead of BOST.
* Various smaller adjustments.
For a detailed list of changes, see share/zoneinfo/NEWS.
Eitan Adler [Sun, 21 Jan 2018 09:01:26 +0000 (01:01 -0800)]
limit(1): fix always true condition
zrj [Sat, 20 Jan 2018 19:32:42 +0000 (21:32 +0200)]
drm/i915: Backport fix for a bad bitmask.
No-op, we explictly disable stolen memory in i915_gem_init_stolen().
Matthew Dillon [Sun, 21 Jan 2018 06:51:38 +0000 (22:51 -0800)]
cpdup - Additional fixes for -X absolute_path
* When an absolute path is specified the file is connsidered
to be local to the machine and is not opened on a remote
source.
Matthew Dillon [Sun, 21 Jan 2018 05:51:48 +0000 (21:51 -0800)]
hammer2 - Correct ip->cluster.nchains gap filler
* Fix a bug where gaps in the cluster array were not being
properly filled. This is only applicable to clusters
consisting of more than one element, which we do not
officially support yet.
Reported-by: zrj (gcc80 found it)
Matthew Dillon [Sun, 21 Jan 2018 05:47:01 +0000 (21:47 -0800)]
cpdup - Enhance -X operation
* Enhance -X operation. When the cpignore file is specified as an
absolute path, it may contain wildcards which match against the
concatenated source path and directory element (as specified in the
source), instead of just match against directory elements.
* Thus an absolute cpignore file may contain full paths and wildcards.
For example, if you:
cpdup -X $cwd/mycpignore /tmp /fubar
And $cwd/mycpignore (specified with an absolute path) contains:
/tmp/xyz/swap*
Then cpdup will not copy files that match against /tmp/xyz/swap*.
If you specify a relative path for the cpignore file, or use the
-x option (instead of -X cpignorefile), operation remains as before
and only matches against the directory element.
Sascha Wildner [Sat, 20 Jan 2018 23:22:27 +0000 (00:22 +0100)]
{bs,quiz}(6): Compare pointers with NULL, not '\0'.
zrj [Sat, 20 Jan 2018 17:26:41 +0000 (19:26 +0200)]
drm/radeon: Disable few unused const arrays.
No functional change.
zrj [Sat, 20 Jan 2018 17:22:13 +0000 (19:22 +0200)]
LINT64: Cleanup for -Wunused-const-variable.
zrj [Sat, 20 Jan 2018 17:17:25 +0000 (19:17 +0200)]
sound/hda: Disable hdac_pcie_snoop struct.
It is currently unused.
zrj [Sat, 20 Jan 2018 17:15:45 +0000 (19:15 +0200)]
kernel/mpt: Fix evaluation of args in macro.
zrj [Sat, 20 Jan 2018 17:08:09 +0000 (19:08 +0200)]
kernel/ncr: Remove unused variable.
zrj [Sat, 20 Jan 2018 17:06:01 +0000 (19:06 +0200)]
kernel/isp: Minor cleanup.
Remove unused string and use 'rqo' only if ISP_TARGET_MODE.
zrj [Sat, 20 Jan 2018 16:59:46 +0000 (18:59 +0200)]
<sys/ktr.h>: Use empty macros for non KTR case.
Cleans up the gcc80 -Wunused-const-variable warnings.
Sascha Wildner [Sat, 20 Jan 2018 18:58:51 +0000 (19:58 +0100)]
kernel/pf: Remove an unused variable.
Markus Pfeiffer [Sat, 20 Jan 2018 13:59:53 +0000 (13:59 +0000)]
terminfo: Add xterm-termite to Makefile.entries
Markus Pfeiffer [Sat, 20 Jan 2018 11:58:18 +0000 (11:58 +0000)]
termcap: Add xterm-termite
zrj [Sat, 20 Jan 2018 10:29:06 +0000 (12:29 +0200)]
drm/linux: Improve linux/log2.h
With newer GCC compilers it is no longer possible to easily detect bad
cases of ilog2() usage in drm shim, see:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72785
There is just a single use case of this macro in drm/radeon/radeon_device.c
for radeon_vm_size, it is already checked to be positive 2^N small number.
So simplify macro and just return 0 for n < 2.
While there, adjust logic to use proper fls(3) and flsll(3) functions
based on integer size (previously both cases where calling flsl(3)).
zrj [Sat, 20 Jan 2018 09:17:16 +0000 (11:17 +0200)]
Fix few typos.
Spotted-by: swildner
Sascha Wildner [Sat, 20 Jan 2018 10:48:46 +0000 (11:48 +0100)]
limits(1): Add missing 'break'.
Sascha Wildner [Sat, 20 Jan 2018 10:37:04 +0000 (11:37 +0100)]
ktrdump(8): Fix wrongly placed 'break' for floating point unpacking.
Sascha Wildner [Sat, 20 Jan 2018 10:28:22 +0000 (11:28 +0100)]
gzip(1): Add some __attribute__((__noreturn__)).
Sascha Wildner [Sat, 20 Jan 2018 09:05:45 +0000 (10:05 +0100)]
pam_exec(8): Raise WARNS to 3.
Sascha Wildner [Sat, 20 Jan 2018 08:37:51 +0000 (09:37 +0100)]
fsdb(8): Fix some -Wformat warnings and raise WARNS to 2.
Sascha Wildner [Sat, 20 Jan 2018 08:07:57 +0000 (09:07 +0100)]
umount(8): Add missing braces.
Sascha Wildner [Fri, 19 Jan 2018 19:13:06 +0000 (20:13 +0100)]
mfiutil(8): Remove -fno-builtin-strftime from CFLAGS.
We don't need this.
Sascha Wildner [Fri, 19 Jan 2018 19:11:33 +0000 (20:11 +0100)]
Provide __{printf,scanf,strfmon,strftime}like() for builtin functions too.
We want our formats checked in -fno-builtin builds as well.
Sascha Wildner [Fri, 19 Jan 2018 12:23:47 +0000 (13:23 +0100)]
bsd.sys.mk: Set -Werror only for compilers that have the warnings fixed.
This reverts part of
b399af1115fa4d2d29e5b5e59eb3a5c3087dccda.
Sascha Wildner [Mon, 31 Jul 2017 19:28:21 +0000 (21:28 +0200)]
bsd.{sys,kern}.mk: Apply warning restrictions for future GCCs.
Sascha Wildner [Fri, 19 Jan 2018 10:16:52 +0000 (11:16 +0100)]
Add __attribute__((__noreturn__)) to a number of usage() like functions.
These were not caught in the -Wsuggest-attribute=noreturn cleanup
because they were already static at that point. There are likely
more such cases but I don't know how to find them systematically.
Sascha Wildner [Fri, 19 Jan 2018 09:19:26 +0000 (10:19 +0100)]
ed(1): Add three __attribute__((__noreturn__)).
I had missed them in
a31274954f5c10e5a80969dcfc719d665f36a26c.