core: smack-setup: Actually allow for succesfully loading CIPSO policy

The line under the last switch statement  *loaded_policy = true;
would never be executed. As all switch cases return 0. Thus the
policy would never be marked as loaded.

Found with Coverity. Fixes: CID#1237785
analyze: fix mem leak

Found with Coverity. Fixes: CID#1237756
core: fix a potential mem leak

Found with Coverity. Fixes: CID#996438
core: use correct function to free CalendarSpec
networkd: remove vestigial event sources

187fe1db took advantage of floating events, but didn't remove pointers
it made superfluous.
resolved: fall back to hardcoded ifindex when checking if a link is the loopback

Reported by Philippe De Swert <philippedeswert@gmail.com>.

Coverity CID#1237656
sd-dhcp: fix test of magic cookie

The magic cookie is set in dhcp_message_init. Test the magic cookie
value intead of writing the last 3/4 of it directly.

Found with Coverity. Fixes: CID#1237732 CID#1237734 CID#1237735
test: fix test of uid-range

The number of uid's in the range should be tested instead of written
directly.

The test still passes with the fix checks.

Found with Coverity. Fixes: CID#1237714 - 1237722
build: colorize gcc only if on tty

Rather than forcing gcc to always produce colorized error messages
whether on tty or not, enable automatic colorization by ensuring
GCC_COLORS is set to a non-empty string.

Doing it this way removes the need for workarounds in ~/.emacs or
~/.vimrc for "M-x compile" or ":make", respectively, to work.
hashmap: introduce hash_ops to make struct Hashmap smaller

It is redundant to store 'hash' and 'compare' function pointers in
struct Hashmap separately. The functions always comprise a pair.
Store a single pointer to struct hash_ops instead.

systemd keeps hundreds of hashmaps, so this saves a little bit of
memory.
hashmap, set: remove unused functions

The following hashmap_* and set_* functions/macros have never had any
users in systemd's history:

  *_iterate_backwards
  *_iterate_skip
  *_last
  *_FOREACH_BACKWARDS

Remove this dead code.
hashmap: minor hashmap_replace optimization

When hashmap_replace detects no such key exists yet, it calls hashmap_put that
performs the same check again. Avoid that by splitting the core of hashmap_put
into a separate function.
sd-bus: use proper ITERATOR_FIRST abstraction

Do not assume hashmap iterators are pointers.
They may be structs in an alternative hashmap implementation.
remove unneeded error.h includes

These are the only two places where this glibc-specific
header is included. However none of the definitions in it
seem to be used, so just remove the includes.
terminal: fix missing hashmap_new() conversions

hashmap_new() now takes *_ops instead of individual functions. Fix up any
missing invokations of it that haven't been converted already.
man: sd_bus_error typo fix
udev: split out help and modernise a bit
udev: split out parse_argv()

Also rename some global variables to arg_* to make it clearer where they come from.
udev: drop duplicate logging

Once upon a time logging during early boot was unreliable, so extra logging messages were
sent by udev to stderr. That is no longer a concern, so drop all fprintf() calls from udved.
udev: don't close std{in,out,err}

Rather than printing debug output to stderr and redirecting this to /dev/null when not wanted,
use the correct log_*() function in the first place.