X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Flog-file.c;h=1ef69a14456ff4a64828266ed9e220a75fa81e02;hb=d047dae8f369ac5cbc3dedf8907b2c05694bb892;hp=20dea918c80ae13813913ecd05f58a7b4d99971d;hpb=fa72c5f0d7f539c7a081995f857f423721948fe4;p=libucw.git diff --git a/lib/log-file.c b/lib/log-file.c index 20dea918..1ef69a14 100644 --- a/lib/log-file.c +++ b/lib/log-file.c @@ -1,7 +1,7 @@ /* * UCW Library -- Keeping of Log Files * - * (c) 1997--2005 Martin Mares + * (c) 1997--2006 Martin Mares * * This software may be freely distributed and used according to the terms * of the GNU Lesser General Public License. @@ -9,6 +9,7 @@ #include "lib/lib.h" #include "lib/lfs.h" +#include "lib/threads.h" #include #include @@ -31,6 +32,7 @@ do_log_switch(struct tm *tm) if (!log_name_patt || log_filename[0] && !log_params) return 0; + ucwlib_lock(); log_switch_nest++; l = strftime(name, log_filename_size, log_name_patt, tm); if (l < 0 || l >= log_filename_size) @@ -49,6 +51,7 @@ do_log_switch(struct tm *tm) switched = 1; } log_switch_nest--; + ucwlib_unlock(); return switched; }