Do not unlink an offline message until it has been correctly enqueued.
While there, simplify the offline_enqueue() function by doing all the
sanity checks in the forked process,  and remove all fatal(): on error,
the offline message is left untouched in the directory.  Also, get rid
of the path_starts_with() check since all paths to offline messages are
now constructed internally.

ok gilles@ chl@
Don't create a history file called -... doh. Pointed out by jmc.
if the portstree gives us a cache directory, use it.
in lots of multi-packages scenarios that all depend on the main package,
this speeds things *a lot*.
case in point: in php 5.2,  make package goes down from 1mn40 to 53s.
Improve flag setting ioctl so that bulk updates are requested
only when we're going up, not when we set PROMISC or any other
flag.  Fixes spontaneous CARP failovers when running tcpdump
on pfsync.

ok henning, mcbride, camield
Don't leak list in complete_cmd_parse if there are no commands found.

Discovered when I was ``borrowing'' this code for something else.

ok djm@
Fix mbstowcs return value documentation. New text based on mbsrtowcs page.
ok jmc
Support multiple search terms, and logical operations -a and -o
to combine them.  The default remains -o; usual precedence applies.
No explicit grouping by parentheses yet.
from kristaps@
Better clock rate .7% error is much better than 7% error.
During pkg_create(1), do not print any warnings or non-fatal errors
from groff(1); of course, fatal errors cannot be ignored.
If you want to polish manuals, use mandoc(1) -Tlint instead.
ok espie@, and millert@ does not object
When a .TP block is broken but already contains a head element,
do not abort(), but delete the head together with the block itself.
Problem found and patch provided by joerg@, thanks!
Sync to ../binutils/Makefile.bsd-wrapper rev. 1.76:
Always install addr2line(1), objcopy(1), and readelf(1) manuals,
even on architectures with !ELF_TOOLCHAIN && !USING_NEW_BINUTILS.
Such architectures do not yet exist, but both symmetry
and fixing potential future issues early  are good ideas.
ok jsing@
remove unused functions

ok gilles@ chl@
When processing .Sh HEAD, as soon as we know which section this is,
fix up the section attributes of the HEAD, it's parent BLOCK, and
all its (text) children.  This is required because the section
attributes get set when each node is allocated, i.e. before processing
the content of the node itself.  Thus, the listed nodes got the section
attribute of the preceding section.  No need to fix up the BODY, all
is fine there already.
Found while implementing TYPE_Sh for mandocdb(8).
Make userret() MI.  On architectures which jammed stuff into it in the
past, pull that code out seperately.
ok guenther miod
oops, need a prototype for ast()
prefix device-specific messages by the device name, since we
support multiple devices
mark the device as closed before closing streams attached to it.
otherwise a stream may try to close the device a second time.
Reduce use of globals in hibernate code.

discussed with deraadt@
sync
Huawei EM770W