]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: file-lock - Remove file_{wait,try}_lock().
authorStephan Bosch <stephan.bosch@open-xchange.com>
Mon, 20 Sep 2021 00:29:55 +0000 (02:29 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 23 Sep 2021 07:03:28 +0000 (07:03 +0000)
src/lib/file-lock.c
src/lib/file-lock.h

index 84d9897d5c0b7e4c50fe58a75cb7f04286038b32..d35d7fdfcaa8fe7468f23a68ec26c2086ab3e672 100644 (file)
@@ -56,13 +56,6 @@ const char *file_lock_method_to_str(enum file_lock_method method)
        i_unreached();
 }
 
-int file_try_lock(int fd, const char *path, int lock_type,
-                 enum file_lock_method lock_method,
-                 struct file_lock **lock_r)
-{
-       return file_wait_lock(fd, path, lock_type, lock_method, 0, lock_r);
-}
-
 int file_try_lock_error(int fd, const char *path, int lock_type,
                        enum file_lock_method lock_method,
                        struct file_lock **lock_r, const char **error_r)
@@ -292,21 +285,6 @@ static int file_lock_do(int fd, const char *path, int lock_type,
        return 1;
 }
 
-int file_wait_lock(int fd, const char *path, int lock_type,
-                  enum file_lock_method lock_method,
-                  unsigned int timeout_secs,
-                  struct file_lock **lock_r)
-{
-       const char *error;
-       int ret;
-
-       ret = file_wait_lock_error(fd, path, lock_type, lock_method,
-                                  timeout_secs, lock_r, &error);
-       if (ret < 0)
-               i_error("%s", error);
-       return ret;
-}
-
 int file_wait_lock_error(int fd, const char *path, int lock_type,
                         enum file_lock_method lock_method,
                         unsigned int timeout_secs,
index d32d5f8029470b87bba14f95bf4fa86f4102aa99..77e0dd9550a2ab15e7c6ee60d2bb7b581820213f 100644 (file)
@@ -23,22 +23,11 @@ const char *file_lock_method_to_str(enum file_lock_method method);
 
 /* Lock the file. Returns 1 if successful, 0 if file is already locked,
    or -1 if error. lock_type is F_WRLCK or F_RDLCK. */
-int file_try_lock(int fd, const char *path, int lock_type,
-                 enum file_lock_method lock_method,
-                 struct file_lock **lock_r);
-/* Like file_try_lock(), but return the error message as a string instead
-   of logging it. Also when returning 0 an error message is returned. */
 int file_try_lock_error(int fd, const char *path, int lock_type,
                        enum file_lock_method lock_method,
                        struct file_lock **lock_r, const char **error_r);
 /* Like lock_try_lock(), but return 0 only after having tried to lock for
    timeout_secs. */
-int file_wait_lock(int fd, const char *path, int lock_type,
-                  enum file_lock_method lock_method,
-                  unsigned int timeout_secs,
-                  struct file_lock **lock_r);
-/* Like file_wait_lock(), but return the error message as a string instead
-   of logging it. Also when returning 0 an error message is returned. */
 int file_wait_lock_error(int fd, const char *path, int lock_type,
                         enum file_lock_method lock_method,
                         unsigned int timeout_secs,