svn commit: r339747 - head/usr.sbin/rtsold

Mark Johnston markj at FreeBSD.org
Thu Oct 25 21:45:25 UTC 2018


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.");


More information about the svn-src-all mailing list