2 Commits

Author SHA1 Message Date
bfa97ed7c7 log: Disable stdout buffering. I want to see output sooner in journalctl.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 34m18s
2025-06-07 13:24:55 -04:00
deae4d5367 ssb: Obviously close the readers before the writer. 2025-06-07 13:19:46 -04:00
2 changed files with 10 additions and 9 deletions

View File

@@ -2026,6 +2026,7 @@ void tf_run_thread_start(const char* zip_path)
#else #else
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
setvbuf(stdout, NULL, _IONBF, 0);
_startup(argc, argv); _startup(argc, argv);
ares_library_init(0); ares_library_init(0);

View File

@@ -2832,15 +2832,6 @@ void tf_ssb_destroy(tf_ssb_t* ssb)
JS_FreeRuntime(ssb->runtime); JS_FreeRuntime(ssb->runtime);
ssb->own_context = false; ssb->own_context = false;
} }
if (ssb->db_writer)
{
int r = sqlite3_close(ssb->db_writer);
if (r != SQLITE_OK)
{
tf_printf("sqlite3_close: %s\n", sqlite3_errstr(r));
}
ssb->db_writer = NULL;
}
while (ssb->broadcasts) while (ssb->broadcasts)
{ {
tf_ssb_broadcast_t* broadcast = ssb->broadcasts; tf_ssb_broadcast_t* broadcast = ssb->broadcasts;
@@ -2856,6 +2847,15 @@ void tf_ssb_destroy(tf_ssb_t* ssb)
tf_printf("sqlite3_close: %s\n", sqlite3_errstr(r)); tf_printf("sqlite3_close: %s\n", sqlite3_errstr(r));
} }
} }
if (ssb->db_writer)
{
int r = sqlite3_close(ssb->db_writer);
if (r != SQLITE_OK)
{
tf_printf("sqlite3_close: %s\n", sqlite3_errstr(r));
}
ssb->db_writer = NULL;
}
ssb->db_readers_count = 0; ssb->db_readers_count = 0;
if (ssb->db_readers) if (ssb->db_readers)
{ {