converted all our existing shared memory code to use a tdb database
[tprouty/samba.git] / source / lib / util.c
index 8f904d486da005483b6a7de67763ce5e81f90828..d3a63691df5f8ca702a8ebdd1638c6546ffa8441 100644 (file)
@@ -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;
+}