X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Flockutil.c;fp=index%2Flockutil.c;h=bebe318bf99f54d5f19c46210a8e0db01a24fbf8;hb=e583a127856d4f363ff2ba7b4321bcc8c048edba;hp=366f93627d9a7bcfc8a6cabd6890aa57e4a6f5d8;hpb=7324debd62e6d2ad57eef4e765cc252604026cd0;p=idzebra-moved-to-github.git diff --git a/index/lockutil.c b/index/lockutil.c index 366f936..bebe318 100644 --- a/index/lockutil.c +++ b/index/lockutil.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: lockutil.c,v $ - * Revision 1.9 1997-09-25 14:54:43 adam + * Revision 1.10 1997-09-29 09:08:36 adam + * Revised locking system to be thread safe for the server. + * + * Revision 1.9 1997/09/25 14:54:43 adam * WIN32 files lock support. * * Revision 1.8 1997/09/17 12:19:15 adam @@ -52,8 +55,6 @@ #include "index.h" -static char *lockDir = NULL; - struct zebra_lock_info { int fd; int excl_flag; @@ -93,15 +94,13 @@ void zebra_lock_destroy (ZebraLockHandle h) xfree (h); } -void zebraLockPrefix (Res res, char *pathPrefix) +void zebra_lock_prefix (Res res, char *path) { - if (!lockDir) - lockDir = res_get_def (res, "lockDir", ""); - assert (lockDir); - - strcpy (pathPrefix, lockDir); - if (*pathPrefix && pathPrefix[strlen(pathPrefix)-1] != '/') - strcat (pathPrefix, "/"); + char *lock_dir = res_get_def (res, "lockDir", ""); + + strcpy (path, lock_dir); + if (*path && path[strlen(path)-1] != '/') + strcat (path, "/"); } #ifdef WINDOWS