summaryrefslogtreecommitdiffstats
path: root/source/lib/util.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1999-12-21 09:25:59 +0000
committerAndrew Tridgell <tridge@samba.org>1999-12-21 09:25:59 +0000
commite48c2d9937eea0667b8cd3332e49c06314ef31e7 (patch)
tree5b16bff92cb8e3a70735df7ce23ea76841ef6d44 /source/lib/util.c
parent4951755413c11d4c5b9af4699a6e622056d52433 (diff)
downloadsamba-e48c2d9937eea0667b8cd3332e49c06314ef31e7.tar.gz
samba-e48c2d9937eea0667b8cd3332e49c06314ef31e7.tar.xz
samba-e48c2d9937eea0667b8cd3332e49c06314ef31e7.zip
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
Diffstat (limited to 'source/lib/util.c')
-rw-r--r--source/lib/util.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/lib/util.c b/source/lib/util.c
index 8f904d486da..d3a63691df5 100644
--- a/source/lib/util.c
+++ b/source/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;
+}