- yaz_global_log_file = fopen(cur_filename, filemode);
- if (l_level < 0) l_level = default_log_level();
- if (l_level & YLOG_FLUSH)
- setvbuf(yaz_global_log_file, 0, _IONBF, 0);
+#endif
+ new_file = fopen(cur_filename, filemode);
+ if (new_file)
+ {
+ yaz_log_close();
+ yaz_global_log_file = new_file;
+ if (l_level & YLOG_FLUSH)
+ setvbuf(yaz_global_log_file, 0, _IONBF, 0);
+ }
+ else
+ {
+ /* disable log rotate */
+ l_max_size = 0;
+ }