Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Oct 2018 21:45:24 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r339747 - head/usr.sbin/rtsold
Message-ID:  <201810252145.w9PLjOHx070342@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Thu Oct 25 21:45:24 2018
New Revision: 339747
URL: https://svnweb.freebsd.org/changeset/base/339747

Log:
  Minor style fixes around script execution.
  
  MFC after:	2 weeks
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/usr.sbin/rtsold/rtsol.c

Modified: head/usr.sbin/rtsold/rtsol.c
==============================================================================
--- head/usr.sbin/rtsold/rtsol.c	Thu Oct 25 21:44:17 2018	(r339746)
+++ head/usr.sbin/rtsold/rtsol.c	Thu Oct 25 21:45:24 2018	(r339747)
@@ -98,22 +98,20 @@ static char *make_rsid(const char *, const char *, str
 #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	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	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, stru
 }
 
 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.");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201810252145.w9PLjOHx070342>