- mutt_quote_filename (f, sizeof (f), path);
-
- snprintf(cmd, sizeof(cmd), "%s %s%s%s%s%s%s%s",
- MCore.dotlock,
- flags & DL_FL_TRY ? "-t " : "",
- flags & DL_FL_UNLOCK ? "-u " : "",
- flags & DL_FL_USEPRIV ? "-p " : "",
- flags & DL_FL_FORCE ? "-f " : "",
- flags & DL_FL_UNLINK ? "-d " : "",
- flags & DL_FL_RETRY ? r : "", f);
-
- return mutt_system (cmd);
-}
-
-static int dotlock_file (const char *path, int retry)
-{
- int r;
- int flags = DL_FL_USEPRIV | DL_FL_RETRY;
-
- if (retry)
- retry = 1;
-
-retry_lock:
- if ((r = invoke_dotlock (path, flags, retry)) == DL_EX_EXIST) {
- if (!option (OPTNOCURSES)) {
- char msg[LONG_STRING];
-
- snprintf (msg, sizeof (msg),
- _("Lock count exceeded, remove lock for %s?"), path);
- if (retry && mutt_yesorno (msg, M_YES) == M_YES) {
- flags |= DL_FL_FORCE;
- retry--;
- mutt_clear_error ();
- goto retry_lock;
- }
- }
- else {
- mutt_error (_("Can't dotlock %s.\n"), path);