dragonfly.git
6 years agoyp*: Staticise.
zrj [Mon, 29 Jan 2018 20:44:34 +0000 (22:44 +0200)]
yp*: Staticise.

While there, make few format fixes.

6 years agomd5(1): Untangle MD5 symbols.
zrj [Tue, 30 Jan 2018 13:05:40 +0000 (15:05 +0200)]
md5(1): Untangle MD5 symbols.

Prefer to use symbols from LibreSSL crypto lib to match SHA ones. Adjust
the function casting to suppress the gcc80 -Wcast-function-type warnings.

While there, print MiB/s instead of bytes/s for benchmarks.

6 years agolibutil: Use local wrapper for exit(3).
zrj [Mon, 29 Jan 2018 19:20:24 +0000 (21:20 +0200)]
libutil: Use local wrapper for exit(3).

Avoids -Wcast-function-type warning.

6 years agocpucontrol(8): Unbreak WORLD_CCOPTLEVEL=2.
zrj [Fri, 2 Feb 2018 07:50:54 +0000 (09:50 +0200)]
cpucontrol(8): Unbreak WORLD_CCOPTLEVEL=2.

Add NO_STRICT_ALIASING for dereferencing type-punned pointers.

6 years agoinit(8): Convert to use sig_atomic_t.
zrj [Mon, 29 Jan 2018 15:57:51 +0000 (17:57 +0200)]
init(8): Convert to use sig_atomic_t.

Instead of returning function pointer, now return enum for the next state.

Avoids -Wcast-function-type warnings.

Taken-from: OpenBSD

6 years agokernel: Avoid long inactivity pauses on very early boot.
zrj [Fri, 2 Feb 2018 06:42:39 +0000 (08:42 +0200)]
kernel: Avoid long inactivity pauses on very early boot.

Increase verbosity a bit on certain setups.

6 years agodrm/linux: Add some dma-buf stubs
François Tigeot [Thu, 1 Feb 2018 20:14:52 +0000 (21:14 +0100)]
drm/linux: Add some dma-buf stubs

6 years agokernel: Avoid empty macros when not INVARIANTS.
zrj [Wed, 31 Jan 2018 19:53:17 +0000 (21:53 +0200)]
kernel: Avoid empty macros when not INVARIANTS.

Visible from MINI64.

6 years agokernel/wlan: Avoid empty macros.
zrj [Wed, 31 Jan 2018 19:36:34 +0000 (21:36 +0200)]
kernel/wlan: Avoid empty macros.

Visible from VKERNEL64.

6 years agokernel: Avoid empty macros.
zrj [Wed, 31 Jan 2018 18:43:13 +0000 (20:43 +0200)]
kernel: Avoid empty macros.

Suppresses last 11 -Wempty-body warnings.

6 years agokernel/ntfs: Avoid empty macros.
zrj [Wed, 31 Jan 2018 18:24:41 +0000 (20:24 +0200)]
kernel/ntfs: Avoid empty macros.

6 years agokernel/acpi: Add braces around empty if body.
zrj [Wed, 31 Jan 2018 18:16:37 +0000 (20:16 +0200)]
kernel/acpi: Add braces around empty if body.

6 years agokernel/hpt*: Avoid empty macros.
zrj [Wed, 31 Jan 2018 18:14:11 +0000 (20:14 +0200)]
kernel/hpt*: Avoid empty macros.

Suppresses 14 -Wempty-body warnings.

6 years agokernel/twa: Avoid empty macros.
zrj [Wed, 31 Jan 2018 17:25:08 +0000 (19:25 +0200)]
kernel/twa: Avoid empty macros.

Suppresses 42 -Wempty-body warnings.

6 years agokernel/netif: Avoid empty if/else bodies.
zrj [Wed, 31 Jan 2018 17:15:16 +0000 (19:15 +0200)]
kernel/netif: Avoid empty if/else bodies.

6 years agoath_hal: Avoid empty macros.
zrj [Wed, 31 Jan 2018 17:05:56 +0000 (19:05 +0200)]
ath_hal: Avoid empty macros.

Fix just two callsights to have a terminating semicolon (rest have it)
and remove it from the macros.

6 years agoix: Avoid empty macros.
zrj [Wed, 31 Jan 2018 15:48:21 +0000 (17:48 +0200)]
ix: Avoid empty macros.

Suppresses 46 -Wempty-body warnings.

6 years agodrm/ttm: Avoid empty macros.
zrj [Wed, 31 Jan 2018 15:47:27 +0000 (17:47 +0200)]
drm/ttm: Avoid empty macros.

Suppresses -Wempty-body warnings.

6 years agodrm/linux: Improve linux/bug.h
zrj [Wed, 31 Jan 2018 15:19:23 +0000 (17:19 +0200)]
drm/linux: Improve linux/bug.h

Suppresses 399 -Wempty-body warnings.

6 years agodrm/linux: Improve linux/lockdep.h
zrj [Wed, 31 Jan 2018 13:57:28 +0000 (15:57 +0200)]
drm/linux: Improve linux/lockdep.h

Suppresses 170 -Wempty-body warnings.

6 years agokernel - Fix kernel minidumps
Matthew Dillon [Thu, 1 Feb 2018 00:12:04 +0000 (16:12 -0800)]
kernel - Fix kernel minidumps

* Refactor minidumps.  Fix an overflows due to KVM now being 8TB, fix
  improper pdp[] array calculations (cropped up when we want to > 1 PML4e
  entry for the kernel), and refactor the page table entry handling code
  to improve efficiency and reduce the dump size.

  If we had kept the original pte mapping in the minidump it would have
  required ~16GB of disk space JUST to hold a pte array that is mostly 0's.
  Now it only requires ~2MB.

  Dumping performance is improved because the page table array is primarily
  flushed to storage in 4KB block sizes, and now only 2MB or so is written
  out in this manner.

* minidump now dumps the PDP array of PD entries (representing 1GB each)
  for the entire system VA space (user and kernel) - 256TB.  This requires
  512*512*8 = 2MB of storage.

  PD pages and PT pages are no longer linearized into an array in the
  minidump.  Instead, their physical addresses are included in the dump
  map and libkvm accesses the PTEs through the physical map.

  NOTE: Only kernel memory proper is actually populated at this time, but
  this leaves the door open for e.g. dumping more information without having
  to change the minidump format again.

* Revamp the minidump header, magic string, and version to address the new
  reality.  libkvm should still be able to recognize the old minidump
  format, as well as now the new one.

Reminded-by: everyone
6 years agodrm/linux: Add linux/irqreturn.h
François Tigeot [Wed, 31 Jan 2018 21:58:23 +0000 (22:58 +0100)]
drm/linux: Add linux/irqreturn.h

6 years agoLINT64: Add a missing '#'.
Sascha Wildner [Wed, 31 Jan 2018 09:17:14 +0000 (10:17 +0100)]
LINT64: Add a missing '#'.

6 years agoLINT64: Add some nata(4) options (they remove code, so commented out).
Sascha Wildner [Wed, 31 Jan 2018 09:08:41 +0000 (10:08 +0100)]
LINT64: Add some nata(4) options (they remove code, so commented out).

6 years agoacpi - Implement a hack to recheck whether devices are present a few times.
Imre Vadász [Sun, 28 Jan 2018 21:06:29 +0000 (22:06 +0100)]
acpi - Implement a hack to recheck whether devices are present a few times.

* This allows various ACPI devices to attach, which depend on another
  device. Often the _STA method declares them absent when the initial ACPI
  namespace walk is done, so we re-check the presence of those devices
  after each global priority round, when probe-/attach-ing children.

6 years agoacpi - Use KOBJ_GPRI_ACPI driver priorities for ig4 and gpio_intel.
Imre Vadász [Sun, 28 Jan 2018 21:04:55 +0000 (22:04 +0100)]
acpi - Use KOBJ_GPRI_ACPI driver priorities for ig4 and gpio_intel.

* Since we currently don't handle the ACPI _DEP methods appropriately,
  use the "global priority hack" from
  5025fc65cd2448de8a5b7295c9936b473a7b0194 to enforce that ig4 and
  gpio_intel attach before various ACPI namespace devices.

* This uses the KOBJ_GPRI_ACPI+1 and KOBJ_GPRI_ACPI+2 driver global priority
  levels for important ACPI drivers, which may have to attach before other
  ACPI devices can be used.

* This also adds the KOBJ_GPRI_ACPI global priority level to the sdhci_acpi
  driver declaration.

6 years agoboot/efi: Sync our TianoCore EDK II headers with the UDK2018 branch.
Sascha Wildner [Tue, 30 Jan 2018 08:16:45 +0000 (09:16 +0100)]
boot/efi: Sync our TianoCore EDK II headers with the UDK2018 branch.

6 years agonewsyslog(8): Comment out zstd support for now.
Sascha Wildner [Mon, 29 Jan 2018 20:09:27 +0000 (21:09 +0100)]
newsyslog(8): Comment out zstd support for now.

6 years agonewsyslog.8: Comment out /etc/newsyslog.conf.d for now.
Sascha Wildner [Mon, 29 Jan 2018 20:06:03 +0000 (21:06 +0100)]
newsyslog.8: Comment out /etc/newsyslog.conf.d for now.

6 years agoSync zoneinfo database with tzdata2018c from ftp://ftp.iana.org/tz/releases
Sascha Wildner [Mon, 29 Jan 2018 19:13:14 +0000 (20:13 +0100)]
Sync zoneinfo database with tzdata2018c from ftp://ftp.iana.org/tz/releases

* Revert Irish changes that relied on negative DST offsets.

* Japanese DST transitions (1948-1951) were Sundays at 00:00, not
    Saturdays or Sundays at 02:00.

For a detailed list of changes, see share/zoneinfo/NEWS.

6 years agoetc/newsyslog.conf: Pull in the confs that are installed by various ports.
Sascha Wildner [Mon, 29 Jan 2018 18:42:12 +0000 (19:42 +0100)]
etc/newsyslog.conf: Pull in the confs that are installed by various ports.

Leave /etc/newsyslog.conf.d commented out for now.

While here, fix a typo in the comments.

Taken-from: FreeBSD

6 years agonewsyslog(8): Further reduce differences with FreeBSD.
Sascha Wildner [Mon, 29 Jan 2018 18:25:02 +0000 (19:25 +0100)]
newsyslog(8): Further reduce differences with FreeBSD.

6 years agovidcontrol(8): Avoid -Wformat-truncation warning.
zrj [Mon, 29 Jan 2018 14:48:15 +0000 (16:48 +0200)]
vidcontrol(8): Avoid -Wformat-truncation warning.

The vinfo.font_size is unsigned short, so use %hu instead of %d.

6 years agoconfig(8): Allow for appending path elements.
zrj [Mon, 29 Jan 2018 14:33:20 +0000 (16:33 +0200)]
config(8): Allow for appending path elements.

Mainly to suppress -Wformat-truncation warning.

6 years agocrunchgen(1): Allow for appending extensions.
zrj [Mon, 29 Jan 2018 14:28:05 +0000 (16:28 +0200)]
crunchgen(1): Allow for appending extensions.

Mainly to suppress -Wformat-truncation warning.

6 years agonewsyslog - implement 'p' flag
Antonio Huete Jimenez [Mon, 29 Jan 2018 01:06:09 +0000 (02:06 +0100)]
newsyslog - implement 'p' flag

Implement the 'p' flag for newsyslog from NetBSD. This flag results in
the first log file for a given file to not be compressed.

While here, don't change file attributes during a no-op run

Obtained-from: FreeBSD (r327451)

6 years agonewsyslog - Fix misc issues
Antonio Huete Jimenez [Mon, 29 Jan 2018 01:02:20 +0000 (02:02 +0100)]
newsyslog - Fix misc issues

When building the command to execute for compression, newsyslog was modifying
the generic arguments array instead of its own copy.
Meaning on the second file to compress with the same arguments, the command line
was not the one expected.
Fix it by creating one copy of the arguments per execution and modifying that
copy.

While here, print the command line executed in verbose mode.

6 years agonewsyslog - Fix typo
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:59:04 +0000 (01:59 +0100)]
newsyslog - Fix typo

Obtained-from: FreeBSD (r326622)

6 years agonewsyslog - Flexible compression program execution
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:57:48 +0000 (01:57 +0100)]
newsyslog - Flexible compression program execution

Allow newsyslog to execute compression commands which
have a semantic different than the traditional gzip(1)

This is done to allow to use zstd(1) as a compression tool without
having to patch it to change its default behavior.

Obtained-from: FreeBSD (r326617)

6 years agonewsyslog - Allow writing RFC5424 compliant rotation message.
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:52:57 +0000 (01:52 +0100)]
newsyslog - Allow writing RFC5424 compliant rotation message.

This modification adds the capability to newsyslog to write the
rotation message in a format that is compliant with RFC5424. This
capability is enabled on a per-log file basis through a new value
("T") in the flags field in newsyslog.conf. This is useful on systems
that use the RFC5424 format for log files so that the rotation message
format matches that of the other log messages. There has been recent
mention of adding an RFC5424 compliant mode to syslogd and at least
one alternative system log daemon (rsyslogd) that already has the
capability to use that format.

Obtained-from: FreeBSD (r318960)

6 years agonewsyslog - Add a new Y flag to newsyslog.conf
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:43:01 +0000 (01:43 +0100)]
newsyslog - Add a new Y flag to newsyslog.conf

This makes newsyslog use zstandard to compress log files.

Given Z is already taken for gzip and zstandard compression level stands in
between gzip and xz (which has the X flag) chosing Y sounds ok :)

Obtained-from: FreeBSD (r316981)

6 years agonewsyslog - Fix typo
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:39:56 +0000 (01:39 +0100)]
newsyslog - Fix typo

Obtained-from: FreeBSD (r308457)

6 years agonewsyslog - More basename/dirname changes
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:38:39 +0000 (01:38 +0100)]
newsyslog - More basename/dirname changes

Properly patch up dirname()/basename() calls to not clobber ent->log.

It turns out that we had a couple of more calls to dirname()/basename()
in newsyslog(8) that assume the input isn't clobbered. This is bad,
because it apparently breaks log rotation now that the new dirname()
implementation has been merged.

Fix this by first copying the input and then calling
dirname()/basename(). While there, improve the naming of variables in
this function a bit.

Obtained-from: FreeBSD (r305651)

6 years agonewsyslog - Clean up basename/dirname calls
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:36:51 +0000 (01:36 +0100)]
newsyslog - Clean up basename/dirname calls

Pull copies of the input pathname string before calling basename() and
dirname() to make this comply to POSIX. Free these copies at the end of
this function. While there, remove the duplication of the 's' ->
'logfname' string. There is no need for this.

Obtained-from: FreeBSD (r303449)

6 years agonewsyslog - Remove unneeded sleep
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:34:42 +0000 (01:34 +0100)]
newsyslog - Remove unneeded sleep

Eliminate unnecessary sleep(10) when -R and -s are specified

After going through the signal work list, during which do_sigwork()
is called and essentially does nothing because -s and -R were
specified on the command line, newsyslog will sleep for 10 seconds
as the (verbose) code says: "Pause 10 seconds to allow daemon(s)
to close log file(s)".

However, the man page verbiage for -R (and -s) seems quite clear
that this sleep() is unnecessary because the daemon was expected
to have already closed the log file before calling newsyslog.

Obtained-from: FreeBSD (r301532)

6 years agonewsyslog - treat 'c' flag in the config as 'C'
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:33:18 +0000 (01:33 +0100)]
newsyslog - treat 'c' flag in the config as 'C'

When -C was introduced in r114137 the plan was to have -C and -c being used for
"create" due to a typo in FreeBSD <= 4.8 a temporary compatibility hack has been
added to make -c being like -G aka GLOB and a warning was issued for the user to
be aware of the futur change for -c.

12 years later it is more than time to remove that hack and finish the what was
intent in r114137

Obtained-from: FreeBSD (r290226)

6 years agonewsyslog - Allow signal names for config
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:31:51 +0000 (01:31 +0100)]
newsyslog - Allow signal names for config

Obtained-from: FreeBSD (r289879)

6 years agonewsyslog - Fix typo
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:19:07 +0000 (01:19 +0100)]
newsyslog - Fix typo

Obtained-from: FreeBSD (r289677)

6 years agonewsyslog - Enhance error mesage
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:14:22 +0000 (01:14 +0100)]
newsyslog - Enhance error mesage

If we fail to send a signal after rotation, print
the pidfile from which the corresponding PID was
obtained.

Obtained-from: FreeBSD (r272763)

6 years agonewsyslog - Initialize the struct tm
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:06:29 +0000 (01:06 +0100)]
newsyslog - Initialize the struct tm

Obtained-from: FreeBSD (r257600)

6 years agonewsyslog - Fix -Wunsequenced
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:02:22 +0000 (01:02 +0100)]
newsyslog - Fix -Wunsequenced

Obtained-from: FreeBSD (r252378)

6 years agonewsyslog - Specify the correct filename
Antonio Huete Jimenez [Sun, 28 Jan 2018 23:56:19 +0000 (00:56 +0100)]
newsyslog - Specify the correct filename

We want to stat the archived log file rather than the logfile itself.

Obtained-from: FreeBSD (r251240)

6 years agonewsyslog - Fix for NFS.
Antonio Huete Jimenez [Sun, 28 Jan 2018 23:48:56 +0000 (00:48 +0100)]
newsyslog - Fix for NFS.

Some filesystems (NFS in particular) do not fill out
the d_type field when returning directory entries through
readdir(3). In this case we need to obtain the file type
ourselves; otherwise newsyslog -t will not be able to
find archived log files and will fail to both delete old
log files and to do interval-based rotations properly.

Obtained-from: FreeBSD (r250545)

6 years agonewsyslog - Fix interval-based rotations when the -t flag is used
Antonio Huete Jimenez [Sun, 28 Jan 2018 23:22:57 +0000 (00:22 +0100)]
newsyslog - Fix interval-based rotations when the -t flag is used

In this case, find the most-recently archived logfile
and use its mtime to determine whether or not to rotate,
as in the non-timestamped case.

Previously we would just try to use the mtime of <logfile>.0,
which always results in a rotation since it generally doesn't
exist in the -t case.

Obtained-from: FreeBSD (r248776)

6 years agonewsyslog - Rename field.
Antonio Huete Jimenez [Sun, 28 Jan 2018 20:49:49 +0000 (21:49 +0100)]
newsyslog - Rename field.

Rename the run_cmd field to sw_runcmd to make it consistent with the
other fields in struct sigwork_entry.

Obtained-from: FreeBSD (r245963)

6 years agonewsyslog - Print correct message.
Antonio Huete Jimenez [Sun, 28 Jan 2018 20:44:29 +0000 (21:44 +0100)]
newsyslog - Print correct message.

Ensure that newsyslog -n prints the correct message for a rotation rule
that uses the 'R' flag.

Obtained-from: FreeBSD (r245962)

6 years agonewsyslog - Initialize some fields
Antonio Huete Jimenez [Sun, 28 Jan 2018 20:42:48 +0000 (21:42 +0100)]
newsyslog - Initialize some fields

When the 'R' flag is used with a newsyslog.conf entry, some fields of
the corresponding struct sigwork_entry were left uninitialized,
potentially causing an early return from do_sigwork(). Ensure that these
fields are initialized, and handle the 'R' flag properly in
do_sigwork().

Obtained-from: FreeBSD (r245961)

6 years agonewsyslog - Update mtime after archiving.
Antonio Huete Jimenez [Sun, 28 Jan 2018 20:40:00 +0000 (21:40 +0100)]
newsyslog - Update mtime after archiving.

Make sure to update the mtime of a logfile after archiving it. This
ensures that the next rotation happens at the correct time when using
interval-based rotations.

Obtained-from: FreeBSD (r244997)

6 years agonewsyslog - Dry-run option implies no root option.
Antonio Huete Jimenez [Sun, 28 Jan 2018 20:30:56 +0000 (21:30 +0100)]
newsyslog - Dry-run option implies no root option.

Have -n imply -r, since dry-run mode obviously doesn't require root
privileges.

Obtained-from: FreeBSD (r244996)

6 years agonewsyslog - Add some missing 'static' keywords
Antonio Huete Jimenez [Sun, 28 Jan 2018 20:25:41 +0000 (21:25 +0100)]
newsyslog - Add some missing 'static' keywords

Obtained-from: FreeBSD (r241777)

6 years agonewsyslog - Signal result checking unneeded
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)

6 years agonewsyslog - Oversize checks.
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)

6 years agonewsyslog - Add new modifier - "R"
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)

6 years agonewsyslog - Fix an old bug in newsyslog
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)

6 years agonewsyslog - Sync manpage's SYNOPSIS with program's usage
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)

6 years agonewsyslog - Make code more friendly to the non-C99 compilers
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)

6 years agocatman(1): Suppress few warnings.
zrj [Sun, 28 Jan 2018 19:42:32 +0000 (21:42 +0200)]
catman(1): Suppress few warnings.

6 years agobsd.sys.mk: Implement WARNS_AUDIT option.
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

6 years agoRemove an unused variable in various Makefile.inc's.
Sascha Wildner [Sun, 28 Jan 2018 17:44:12 +0000 (18:44 +0100)]
Remove an unused variable in various Makefile.inc's.

6 years agogames: Add FALLTHROUGH where missing.
zrj [Sun, 28 Jan 2018 17:08:25 +0000 (19:08 +0200)]
games: Add FALLTHROUGH where missing.

6 years agotetris(6): Fix -Wformat-truncation warning.
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).

6 years agorogue(6): General cleanup.
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

6 years agophantasia(6): General cleanup.
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)

6 years agohack(6): Suppress warnings.
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.

6 years agosyscons - Untangle device attachement from isa?, attach to nexus? instead.
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.

6 years agoled(4): Turn this into a module. Only used by acpi_thinkpad and acpi_asus.
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.

6 years agogames: Do not override default CFLAGS.
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.

6 years agolibfetch: Suppress fallthrough warning.
zrj [Sun, 28 Jan 2018 14:44:03 +0000 (16:44 +0200)]
libfetch: Suppress fallthrough warning.

6 years agoPrefer https over http in commit template
Eitan Adler [Sun, 28 Jan 2018 05:34:46 +0000 (21:34 -0800)]
Prefer https over http in commit template

6 years agoShifting into or out of an int's sign bit is undefined, and this loop
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"
6 years agobus_dma.9: Add a few lines about bus_dmamap_load_ccb().
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.

6 years ago<sys/cdefs.h>: Add __alloc_size2() for functions taking number and size.
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
6 years ago<sys/cdefs.h>: Make __nonnull variadic.
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.

6 years agolvm(8): Add line editing support (libedit is already linked).
Sascha Wildner [Fri, 26 Jan 2018 17:16:50 +0000 (18:16 +0100)]
lvm(8): Add line editing support (libedit is already linked).

6 years agolibedit: Check dereferenced pointer for NULL.
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
6 years agoFix two more gcc80 -Wsizeof-pointer-memaccess warnings.
Sascha Wildner [Wed, 24 Jan 2018 18:00:19 +0000 (19:00 +0100)]
Fix two more gcc80 -Wsizeof-pointer-memaccess warnings.

6 years agopppctl(8): Avoid overlapping strcpy() copies.
zrj [Wed, 24 Jan 2018 16:07:37 +0000 (18:07 +0200)]
pppctl(8): Avoid overlapping strcpy() copies.

Use intermediate.

6 years agotelnet(1): Avoid overlapping strncpy() copies.
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.

6 years agopax(1): Honour the restrict in sigaction().
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

6 years agodd(1): Use a local swapbytes() function.
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

6 years agomille(6): General cleanup.
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.

6 years agopf: Fix bzero() argument.
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
6 years agoktrdump(8): Fix bzero() argument on error.
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
6 years agovinum(8): Allow for terminating NULL.
zrj [Wed, 24 Jan 2018 07:57:06 +0000 (09:57 +0200)]
vinum(8): Allow for terminating NULL.

Mainly to suppress -Wstringop-overflow warning.

6 years agocvs(1): Avoid -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.

6 years agoFix gcc80 -Wbool-operation warnings in fortune(6) and hack(6).
Sascha Wildner [Wed, 24 Jan 2018 08:32:42 +0000 (09:32 +0100)]
Fix gcc80 -Wbool-operation warnings in fortune(6) and hack(6).

6 years agoFix a number of gcc80 -Wsizeof-pointer-memaccess warnings.
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.

6 years agognu/lib: Raise WARNS generally to 1 via Makefile.inc.
Sascha Wildner [Tue, 23 Jan 2018 20:19:57 +0000 (21:19 +0100)]
gnu/lib: Raise WARNS generally to 1 via Makefile.inc.

6 years agolibm: Avoid left-shifting negative integers.
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

6 years agoipfw: Avoid left-shifting negative integers.
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.