+void buffered_log_stream::watch_removed() noexcept
+{
+ if (fd > STDERR_FILENO) {
+ close(fd);
+ fd = -1;
+ }
+ // Here we rely on there only being two logs, console and "main"; we can check if we are the
+ // main log via identity:
+ if (&log_stream[DLOG_MAIN] == this) {
+ external_log_open = false;
+ }
+}
+
+} // end namespace
+