In the light of #12926 I needed some log messages for testing. This
tmpfiles one came to mind, since it's frequently seen on typical Fedora
systems. Alas, they didn't actually use log_syntax, and thus weren't
recognizable by the new config file urlifaction code. Let's fix that.
This means the the code needs to be kept compatible in the shared header,
but I think that still nicer than having two places to declare the same
things.
I added src/boot to -I, so that efi/foo.h needs to be used. This reduces
the potential for accidentally including the wrong header.
Now all short-*, verbose, with-unit modes are handled. cat, export, json-* are
not, but those are usually used for post-processing, so I don't think it'd be
useful there.
Fixes#12931.
In file included from ../src/basic/macro.h:558,
from ../src/basic/alloc-util.h:9,
from ../src/network/networkd-link.c:7:
../src/network/networkd-link.c: In function ‘link_sysctl_ipv6_enabled’:
../src/basic/log.h:107:9: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
107 | log_internal_realm(LOG_REALM_PLUS_LEVEL(LOG_REALM, (level)), __VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/shared/log-link.h:21:25: note: in expansion of macro ‘log_internal’
21 | log_internal(level, error, _FILE_, __LINE__, __func__, ##__VA_ARGS__); \
| ^~~~~~~~~~~~
../src/shared/log-link.h:33:50: note: in expansion of macro ‘log_link_full’
33 | #define log_link_warning_errno(link, error, ...) log_link_full(link, LOG_WARNING, error, ##__VA_ARGS__)
| ^~~~~~~~~~~~~
../src/network/networkd-link.c:83:24: note: in expansion of macro ‘log_link_warning_errno’
83 | return log_link_warning_errno(link, r,
| ^~~~~~~~~~~~~~~~~~~~~~
../src/network/networkd-link.c:84:77: note: format string is defined here
84 | "Failed to read net.ipv6.conf.%s.disable_ipv6 sysctl property: %m",
| ^~
cc1: some warnings being treated as errors
With gcc-9.1.1-2.fc31.x86_64 and -Doptimization=2:
../src/shared/dm-util.c: In function ‘dm_deferred_remove’:
../src/shared/dm-util.c:35:9: warning: ‘strncpy’ specified bound 128 equals destination size [-Wstringop-truncation]
35 | strncpy(dm.name, name, sizeof(dm.name));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc is plain wrong here, because we checked strlen(name) a few lines above, so
there can be no truncation and even the terminator always fits. But let's avoid
the warning.
Make use of curl_multi_assign to associate each IO sd_event_source with
a CURL object. This means we always get passed the right event source
and don't need to worry about looking up the associated CURL object,
particularly in the case where the FD has been closed on a REMOVE event.