diff options
| author | Sergey Nikiforov <Sergey.Nikiforov@kaspersky.com> | 2020-02-11 11:07:13 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2020-02-11 11:07:13 +0000 |
| commit | a4819e456c7525890a2647775a9b5553b8659a3f (patch) | |
| tree | 1d9f9a7baae440790de0ea18bba612acab810036 /src/if.c | |
| parent | eaf099b3e5caaa11b2034ea82fe4c192e81e2ce8 (diff) | |
| download | dhcpcd-a4819e456c7525890a2647775a9b5553b8659a3f.tar.xz | |
logerr: Use macros to call log functions
This allows downstream implementions to inject their own data
into the log message and/or supply new logging targets whilst
preserving macros such as __FILE__ and __LINE__.
Diffstat (limited to 'src/if.c')
| -rw-r--r-- | src/if.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -30,6 +30,7 @@ #include <sys/types.h> #include <sys/ioctl.h> #include <sys/socket.h> +#include <syslog.h> #include "config.h" @@ -462,8 +463,9 @@ if_discover(struct dhcpcd_ctx *ctx, struct ifaddrs **ifaddrs, #endif if (if_vimaster(ctx, spec.devname) == 1) { - logfunc_t *logfunc = argc != 0 ? logerrx : logdebugx; - logfunc("%s: is a Virtual Interface Master, skipping", + int loglevel = argc != 0 ? LOG_ERR : LOG_DEBUG; + logmessage(loglevel, + "%s: is a Virtual Interface Master, skipping", spec.devname); continue; } |
