summaryrefslogtreecommitdiffstats
path: root/src/if.c
diff options
context:
space:
mode:
authorSergey Nikiforov <Sergey.Nikiforov@kaspersky.com>2020-02-11 11:07:13 +0000
committerRoy Marples <roy@marples.name>2020-02-11 11:07:13 +0000
commitb586bfbfecae8eb425974c9eafd005a04fb2f114 (patch)
tree1d9f9a7baae440790de0ea18bba612acab810036 /src/if.c
parent03cdd9d6a8b3f7de46a9603a2d3007182e369965 (diff)
downloaddhcpcd-b586bfbfecae8eb425974c9eafd005a04fb2f114.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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/if.c b/src/if.c
index a4bf4d61..e27f2bab 100644
--- a/src/if.c
+++ b/src/if.c
@@ -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;
}