]> mj.ucw.cz Git - libucw.git/commitdiff
Logging: Let log_file() maintain proper use count of the stream.
authorMartin Mares <mj@ucw.cz>
Mon, 16 Feb 2009 22:59:44 +0000 (23:59 +0100)
committerMartin Mares <mj@ucw.cz>
Mon, 16 Feb 2009 22:59:44 +0000 (23:59 +0100)
ucw/log-file.c

index cd0d037c478e0e09ffe7a58c90ae9b35055d6c0c..f04e68dc2aab4d03e3bd65d866c9fb638c07669a 100644 (file)
@@ -193,6 +193,7 @@ log_file(const char *name)
   struct log_stream *def = log_stream_by_flags(0);
   log_rm_substream(def, NULL);
   log_add_substream(def, ls);
+  log_close_stream(ls);
 }
 
 #ifdef TEST
@@ -205,6 +206,7 @@ int main(int argc, char **argv)
   // struct log_stream *ls = log_new_file("/tmp/quork-%Y%m%d-%H%M%S");
   for (int i=1; i<argc; i++)
     msg(L_INFO, argv[i]);
+  log_close_all();
   return 0;
 }