svn commit: r262556 - stable/10/sbin/ifconfig

Dag-Erling Smørgrav des at FreeBSD.org
Thu Feb 27 13:08:43 UTC 2014


Author: des
Date: Thu Feb 27 13:08:43 2014
New Revision: 262556
URL: http://svnweb.freebsd.org/changeset/base/262556

Log:
  MFH (r256768): don't report an error for no-op add / remove

Modified:
  stable/10/sbin/ifconfig/ifgroup.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sbin/ifconfig/ifgroup.c
==============================================================================
--- stable/10/sbin/ifconfig/ifgroup.c	Thu Feb 27 13:05:56 2014	(r262555)
+++ stable/10/sbin/ifconfig/ifgroup.c	Thu Feb 27 13:08:43 2014	(r262556)
@@ -57,7 +57,7 @@ setifgroup(const char *group_name, int d
 
 	if (strlcpy(ifgr.ifgr_group, group_name, IFNAMSIZ) >= IFNAMSIZ)
 		errx(1, "setifgroup: group name too long");
-	if (ioctl(s, SIOCAIFGROUP, (caddr_t)&ifgr) == -1)
+	if (ioctl(s, SIOCAIFGROUP, (caddr_t)&ifgr) == -1 && errno != EEXIST)
 		err(1," SIOCAIFGROUP");
 }
 
@@ -75,7 +75,7 @@ unsetifgroup(const char *group_name, int
 
 	if (strlcpy(ifgr.ifgr_group, group_name, IFNAMSIZ) >= IFNAMSIZ)
 		errx(1, "unsetifgroup: group name too long");
-	if (ioctl(s, SIOCDIFGROUP, (caddr_t)&ifgr) == -1)
+	if (ioctl(s, SIOCDIFGROUP, (caddr_t)&ifgr) == -1 && errno != ENOENT)
 		err(1, "SIOCDIFGROUP");
 }
 


More information about the svn-src-all mailing list