From 4e1291a83f61a72989045879763d9ef05fd38f71 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 21 Dec 1999 09:25:59 +0000 Subject: converted all our existing shared memory code to use a tdb database instead of either sysv or mmap shared memory or lock files. this means we can now completely remove locking_shm.c locking_slow.c shmem.c shmem_sysv.c and lots of other things also got simpler locking.c got a bit larger, but is much better compartmentalised now (This used to be commit e48c2d9937eea0667b8cd3332e49c06314ef31e7) --- source3/lib/util.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'source3/lib') diff --git a/source3/lib/util.c b/source3/lib/util.c index 8f904d486d..d3a63691df 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -3213,3 +3213,24 @@ char *myhostname(void) } return ret; } + + +/***************************************************************** +a useful function for returning a path in the Samba lock directory + *****************************************************************/ +char *lock_path(char *name) +{ + static pstring fname; + + pstrcpy(fname,lp_lockdir()); + trim_string(fname,"","/"); + + if (!directory_exist(fname,NULL)) { + mkdir(fname,0755); + } + + pstrcat(fname,"/"); + pstrcat(fname,name); + + return fname; +} -- cgit