> On Sept. 19, 2017, 2:18 a.m., Qian Zhang wrote: > > src/slave/containerizer/mesos/isolators/network/ports.cpp > > Line 112 (original), 112-117 (patched) > > <https://reviews.apache.org/r/60495/diff/15-16/?file=1818171#file1818171line112> > > > > Can we change this to `while ((entry = readdir(dir)) != nullptr) {` and > > do `errno = 0` in the end of the while loop? There is already a `errno = 0` > > (line 106) right before the while loop, so I think we may not need to do it > > again at the beginning of the loop, instead it would be better to do it in > > the end of the loop.
I removed the extraneous `errno` write, and pulled the code that checks for `readdir` failure up into the loop so the error checking happens near the call site. - James ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/60495/#review185635 ----------------------------------------------------------- On Sept. 19, 2017, 12:19 a.m., James Peach wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/60495/ > ----------------------------------------------------------- > > (Updated Sept. 19, 2017, 12:19 a.m.) > > > Review request for mesos, Qian Zhang and Jiang Yan Xu. > > > Bugs: MESOS-7675 > https://issues.apache.org/jira/browse/MESOS-7675 > > > Repository: mesos > > > Description > ------- > > Implemented network ports isolator socket utilities to find the > inode numbers of all the listening sockets, and the inodes of the > open sockets for a process. Together, these utilities can tell us > which sockets a process is listening on. > > > Diffs > ----- > > src/slave/containerizer/mesos/isolators/network/ports.hpp PRE-CREATION > src/slave/containerizer/mesos/isolators/network/ports.cpp PRE-CREATION > > > Diff: https://reviews.apache.org/r/60495/diff/16/ > > > Testing > ------- > > make check (Fedora 26) > > > Thanks, > > James Peach > >
