return lock->path;
}
+void file_lock_set_path(struct file_lock *lock, const char *path)
+{
+ if (path != lock->path) {
+ i_free(lock->path);
+ lock->path = i_strdup(path);
+ }
+}
+
void file_lock_wait_start(void)
{
i_assert(lock_wait_start.tv_sec == 0);
/* Returns the path given as parameter to file_*lock*(). */
const char *file_lock_get_path(struct file_lock *lock);
+/* Update lock file's path (after it gets renamed by the caller). This is
+ useful mainly together with file_lock_set_unlink_on_free(). */
+void file_lock_set_path(struct file_lock *lock, const char *path);
/* Returns human-readable string containing the process that has the file
currently locked. Returns "" if unknown, otherwise " (string)". */