projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Simplify sidebar code
[apps/madmutt.git]
/
mx.c
diff --git
a/mx.c
b/mx.c
index
1d5a750
..
fde597c
100644
(file)
--- a/
mx.c
+++ b/
mx.c
@@
-58,7
+58,7
@@
static list2_t* MailboxFormats = NULL;
* retry - should retry if unable to lock?
*/
* retry - should retry if unable to lock?
*/
-static int invoke_dotlock (const char *path, int
dummy, int
flags, int retry)
+static int invoke_dotlock (const char *path, int flags, int retry)
{
char cmd[LONG_STRING + _POSIX_PATH_MAX];
char f[SHORT_STRING + _POSIX_PATH_MAX];
{
char cmd[LONG_STRING + _POSIX_PATH_MAX];
char f[SHORT_STRING + _POSIX_PATH_MAX];
@@
-82,7
+82,7
@@
static int invoke_dotlock (const char *path, int dummy, int flags, int retry)
return mutt_system (cmd);
}
return mutt_system (cmd);
}
-static int dotlock_file (const char *path, int
fd, int
retry)
+static int dotlock_file (const char *path, int retry)
{
int r;
int flags = DL_FL_USEPRIV | DL_FL_RETRY;
{
int r;
int flags = DL_FL_USEPRIV | DL_FL_RETRY;
@@
-91,7
+91,7
@@
static int dotlock_file (const char *path, int fd, int retry)
retry = 1;
retry_lock:
retry = 1;
retry_lock:
- if ((r = invoke_dotlock (path, f
d, f
lags, retry)) == DL_EX_EXIST) {
+ if ((r = invoke_dotlock (path, flags, retry)) == DL_EX_EXIST) {
if (!option (OPTNOCURSES)) {
char msg[LONG_STRING];
if (!option (OPTNOCURSES)) {
char msg[LONG_STRING];
@@
-111,9
+111,9
@@
retry_lock:
return (r == DL_EX_OK ? 0 : -1);
}
return (r == DL_EX_OK ? 0 : -1);
}
-static int undotlock_file (const char *path
, int fd
)
+static int undotlock_file (const char *path)
{
{
- return (invoke_dotlock (path,
fd,
DL_FL_USEPRIV | DL_FL_UNLOCK, 0) ==
+ return (invoke_dotlock (path, DL_FL_USEPRIV | DL_FL_UNLOCK, 0) ==
DL_EX_OK ? 0 : -1);
}
DL_EX_OK ? 0 : -1);
}
@@
-236,7
+236,7
@@
int mx_lock_file (const char *path, int fd, int excl, int dot, int time_out)
#ifdef USE_DOTLOCK
if (r == 0 && dot)
#ifdef USE_DOTLOCK
if (r == 0 && dot)
- r = dotlock_file (path,
fd,
time_out);
+ r = dotlock_file (path, time_out);
#endif /* USE_DOTLOCK */
if (r == -1) {
#endif /* USE_DOTLOCK */
if (r == -1) {
@@
-274,13
+274,13
@@
int mx_unlock_file (const char *path, int fd, int dot)
#ifdef USE_DOTLOCK
if (dot)
#ifdef USE_DOTLOCK
if (dot)
- undotlock_file (path
, fd
);
+ undotlock_file (path);
#endif
return 0;
}
#endif
return 0;
}
-void mx_unlink_empty (const char *path)
+
static
void mx_unlink_empty (const char *path)
{
int fd;
{
int fd;
@@
-297,7
+297,7
@@
void mx_unlink_empty (const char *path)
}
#ifdef USE_DOTLOCK
}
#ifdef USE_DOTLOCK
- invoke_dotlock (path,
fd,
DL_FL_UNLINK, 1);
+ invoke_dotlock (path, DL_FL_UNLINK, 1);
#else
if (fstat (fd, &sb) == 0 && sb.st_size == 0)
unlink (path);
#else
if (fstat (fd, &sb) == 0 && sb.st_size == 0)
unlink (path);
@@
-1368,7
+1368,7
@@
int mx_rebuild_cache (void) {
if (magic != M_MAILDIR && magic != M_MH && magic != M_IMAP)
continue;
sidebar_set_current (b->path);
if (magic != M_MAILDIR && magic != M_MH && magic != M_IMAP)
continue;
sidebar_set_current (b->path);
- sidebar_draw (
CurrentMenu
);
+ sidebar_draw ();
if ((ctx = mx_open_mailbox (b->path,
M_READONLY | M_NOSORT | M_COUNT,
NULL)) != NULL)
if ((ctx = mx_open_mailbox (b->path,
M_READONLY | M_NOSORT | M_COUNT,
NULL)) != NULL)
@@
-1378,7
+1378,7
@@
int mx_rebuild_cache (void) {
if (Context && Context->path)
sidebar_set_current (Context->path);
if (Context && Context->path)
sidebar_set_current (Context->path);
- sidebar_draw (
CurrentMenu
);
+ sidebar_draw ();
return (0);
#endif
return (0);
#endif