Re: ifconfig.c redundancy the second
On Fri, Jan 13, 2023 at 09:18:30PM +0100, Mathias Koehler wrote: > Ehm well it should look like this, sorry: This code duplication has now been removed. Thanks! > === > RCS file: /cvs/src/sbin/ifconfig/ifconfig.c,v > retrieving revision 1.460 > diff -u -p -u -p -r1.460 ifconfig.c > --- ifconfig.c 18 Dec 2022 18:56:38 - 1.460 > +++ ifconfig.c 13 Jan 2023 18:52:48 - > @@ -1907,12 +1907,14 @@ delifjoinlist(const char *val, int d) > memset(, 0, sizeof(join)); > join.i_flags |= (IEEE80211_JOIN_DEL | IEEE80211_JOIN_DEL_ALL); > > + /* > if (d == -1) { > ifr.ifr_data = (caddr_t) > if (ioctl(sock, SIOCS80211JOIN, (caddr_t)) == -1) > err(1, "SIOCS80211JOIN"); > return; > } > + */ > > ifr.ifr_data = (caddr_t) > >
Re: ifconfig.c redundancy the second
Ehm well it should look like this, sorry: === RCS file: /cvs/src/sbin/ifconfig/ifconfig.c,v retrieving revision 1.460 diff -u -p -u -p -r1.460 ifconfig.c --- ifconfig.c 18 Dec 2022 18:56:38 - 1.460 +++ ifconfig.c 13 Jan 2023 18:52:48 - @@ -1907,12 +1907,14 @@ delifjoinlist(const char *val, int d) memset(, 0, sizeof(join)); join.i_flags |= (IEEE80211_JOIN_DEL | IEEE80211_JOIN_DEL_ALL); + /* if (d == -1) { ifr.ifr_data = (caddr_t) if (ioctl(sock, SIOCS80211JOIN, (caddr_t)) == -1) err(1, "SIOCS80211JOIN"); return; } + */ ifr.ifr_data = (caddr_t)
Re: ifconfig.c redundancy the second
On Fri, Jan 13, 2023 at 08:04:36PM +0100, Mathias Koehler wrote: > I hope the following message is a format more helpful for you > guys. (Thanks to Otto Moerbeek who gave me a hint.) /% ... %./ is not a comment marker in C. -Otto > Again my question is how should that code look like? > Because I can remove the 'if' and the code still does the same. > > === > RCS file: /cvs/src/sbin/ifconfig/ifconfig.c,v > retrieving revision 1.460 > diff -u -p -u -p -r1.460 ifconfig.c > --- ifconfig.c 18 Dec 2022 18:56:38 - 1.460 > +++ ifconfig.c 13 Jan 2023 18:52:48 - > @@ -1907,12 +1907,14 @@ delifjoinlist(const char *val, int d) > memset(, 0, sizeof(join)); > join.i_flags |= (IEEE80211_JOIN_DEL | IEEE80211_JOIN_DEL_ALL); > > + /% > if (d == -1) { > ifr.ifr_data = (caddr_t) > if (ioctl(sock, SIOCS80211JOIN, (caddr_t)) == -1) > err(1, "SIOCS80211JOIN"); > return; > } > + %/ > > ifr.ifr_data = (caddr_t) > if (ioctl(sock, SIOCS80211JOIN, (caddr_t)) == -1) >
ifconfig.c redundancy the second
I hope the following message is a format more helpful for you guys. (Thanks to Otto Moerbeek who gave me a hint.) Again my question is how should that code look like? Because I can remove the 'if' and the code still does the same. === RCS file: /cvs/src/sbin/ifconfig/ifconfig.c,v retrieving revision 1.460 diff -u -p -u -p -r1.460 ifconfig.c --- ifconfig.c 18 Dec 2022 18:56:38 - 1.460 +++ ifconfig.c 13 Jan 2023 18:52:48 - @@ -1907,12 +1907,14 @@ delifjoinlist(const char *val, int d) memset(, 0, sizeof(join)); join.i_flags |= (IEEE80211_JOIN_DEL | IEEE80211_JOIN_DEL_ALL); + /% if (d == -1) { ifr.ifr_data = (caddr_t) if (ioctl(sock, SIOCS80211JOIN, (caddr_t)) == -1) err(1, "SIOCS80211JOIN"); return; } + %/ ifr.ifr_data = (caddr_t) if (ioctl(sock, SIOCS80211JOIN, (caddr_t)) == -1)