nfd = accept_partner1;
}
// FD_SET(accept_partner2, &fds);
- if (accept_partner1 > nfd) {
- nfd = accept_partner1;
+ if (accept_partner2 > nfd) {
+ nfd = accept_partner2;
}
for (auto reader : readers) {
if (!reader.second) {
if (fd < 0) {
cerr << "accept2 failed " << strerror(errno) << endl;
} else {
- if (fcntl(fd, F_SETFL, O_NONBLOCK)) {
+ if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0) {
cerr << "fcntl NONBLOCK " << strerror(errno) << endl;
}
readers[fd] = true;
if (!reader.second) {
continue;
}
- int fd = reader.first;
+ int fd = reader.first;
if (FD_ISSET(fd, &fds)) {
char buf[128];
int cc = read(fd, buf, 128);
// If there was another owner the previous library manager collection
// was not destroyed and libraries not closed.
- if (!weak_lmc.expired()) {
+ boost::shared_ptr<LibraryManagerCollection> still_here = weak_lmc.lock();
+ if (still_here) {
// Restore the library manager collection.
- boost::shared_ptr<LibraryManagerCollection> restored_lmc = weak_lmc.lock();
- if (restored_lmc) {
- lm_collection_ = restored_lmc;
- return (false);
- }
- // The library manager collection was destroyed between calls to
- // expired and lock.
- // assert(weak_lmc.expired());
+ lm_collection_ = still_here;
+ return (false);
}
// Load the empty set of libraries.