diff options
author | Mark Johnston <markj@FreeBSD.org> | 2018-10-25 21:45:24 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2018-10-25 21:45:24 +0000 |
commit | 2b2135b8b55637077a8c6b1a9a491facb5f0471f (patch) | |
tree | 2bddf763b1c702a79c3fdc807687ea0f1cf5025d /usr.sbin | |
parent | b1c91e4b6cb7b84d3c1fe1e69bff825442351506 (diff) | |
download | src-2b2135b8b55637077a8c6b1a9a491facb5f0471f.tar.gz src-2b2135b8b55637077a8c6b1a9a491facb5f0471f.zip |
Minor style fixes around script execution.
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Notes
Notes:
svn path=/head/; revision=339747
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/rtsold/rtsol.c | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/usr.sbin/rtsold/rtsol.c b/usr.sbin/rtsold/rtsol.c index 4d3f9be6f5ee..a10cd4c510d6 100644 --- a/usr.sbin/rtsold/rtsol.c +++ b/usr.sbin/rtsold/rtsol.c @@ -98,22 +98,20 @@ static char *make_rsid(const char *, const char *, struct rainfo *); #define _ARGS_RESADD resolvconf_script, "-a", rsid #define _ARGS_RESDEL resolvconf_script, "-d", rsid -#define CALL_SCRIPT(name, sm_head) \ - do { \ - const char *const sarg[] = { _ARGS_##name, NULL }; \ - call_script(sizeof(sarg), sarg, sm_head); \ - } while(0) - -#define ELM_MALLOC(p,error_action) \ - do { \ - p = malloc(sizeof(*p)); \ - if (p == NULL) { \ - warnmsg(LOG_ERR, __func__, "malloc failed: %s", \ - strerror(errno)); \ - error_action; \ - } \ - memset(p, 0, sizeof(*p)); \ - } while(0) +#define CALL_SCRIPT(name, sm_head) do { \ + const char *const sarg[] = { _ARGS_##name, NULL }; \ + call_script(sizeof(sarg), sarg, sm_head); \ +} while (0) + +#define ELM_MALLOC(p, error_action) do { \ + p = malloc(sizeof(*p)); \ + if (p == NULL) { \ + warnmsg(LOG_ERR, __func__, "malloc failed: %s", \ + strerror(errno)); \ + error_action; \ + } \ + memset(p, 0, sizeof(*p)); \ +} while (0) int sockopen(void) @@ -697,13 +695,12 @@ make_rsid(const char *ifname, const char *origin, struct rainfo *rai) } int -ra_opt_rdnss_dispatch(struct ifinfo *ifi, - struct rainfo *rai, +ra_opt_rdnss_dispatch(struct ifinfo *ifi, struct rainfo *rai, struct script_msg_head_t *sm_rdnss_head, struct script_msg_head_t *sm_dnssl_head) { - const char *r; struct script_msg *smp1; + const char *r; int error; error = 0; @@ -715,10 +712,7 @@ ra_opt_rdnss_dispatch(struct ifinfo *ifi, } TAILQ_CONCAT(sm_rdnss_head, sm_dnssl_head, sm_next); - if (rai != NULL && uflag) - r = make_rsid(ifi->ifname, DNSINFO_ORIGIN_LABEL, rai); - else - r = make_rsid(ifi->ifname, DNSINFO_ORIGIN_LABEL, NULL); + r = make_rsid(ifi->ifname, DNSINFO_ORIGIN_LABEL, uflag ? rai : NULL); if (r == NULL) { warnmsg(LOG_ERR, __func__, "make_rsid() failed. " "Script was not invoked."); |