If we are in this block, then p == channel_fds.end() and p->first is not
valid.
Also, no need to populate channel_fds with an fd of -1.
Fixes: https://tracker.ceph.com/issues/51816
Signed-off-by: Sage Weil <sage@newdream.net>
if (fd < 0) {
int err = -errno;
dout(1) << "unable to write to '" << log_file << "' for channel '"
- << p->first << "': " << cpp_strerror(err) << dendl;
+ << channel << "': " << cpp_strerror(err) << dendl;
+ } else {
+ channel_fds[channel] = fd;
}
- channel_fds[channel] = fd;
}
} else {
fd = p->second;