X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-mx%2Fcompress.c;h=ec4db2b33514006d17862006f84261e34683456b;hp=67f72bce5d9ad51a92bc622900789a882be275ca;hb=a833478d0bab31dd0016520da5049bdf45b29736;hpb=33b9fa940ce6aa57c6fa68a4b5b505f9dcbbb436 diff --git a/lib-mx/compress.c b/lib-mx/compress.c index 67f72bc..ec4db2b 100644 --- a/lib-mx/compress.c +++ b/lib-mx/compress.c @@ -38,7 +38,7 @@ static int mbox_lock_compressed (CONTEXT * ctx, FILE * fp, int excl, int retry) { int r; - if ((r = mx_lock_file (ctx->realpath, fileno (fp), excl, 1, retry)) == 0) + if ((r = mx_lock_file (ctx->realpath, fileno (fp), excl, retry)) == 0) ctx->locked = 1; else if (retry && !excl) { ctx->readonly = 1; @@ -52,15 +52,14 @@ static void mbox_unlock_compressed (CONTEXT * ctx, FILE * fp) { if (ctx->locked) { fflush (fp); - - mx_unlock_file (ctx->realpath, fileno (fp), 1); + mx_unlock_file(ctx->realpath, fileno(fp)); ctx->locked = 0; } } static int is_new (const char *path) { - return (access (path, W_OK) && errno == ENOENT); + return access (path, W_OK) && errno == ENOENT; } static const char *find_compress_hook (int type, const char *path) @@ -103,7 +102,7 @@ int mutt_can_append_compressed (const char *path) int magic; if (is_new (path)) - return (find_compress_hook (M_CLOSEHOOK, path) ? 1 : 0); + return find_compress_hook (M_CLOSEHOOK, path) ? 1 : 0; magic = mx_get_magic (path); @@ -308,9 +307,7 @@ int mutt_open_append_compressed (CONTEXT * ctx) m_fclose(&fh); ctx->path = p_dupstr(tmppath, m_strlen(tmppath)); - - ctx->magic = DefaultMagic; - + ctx->magic = M_MBOX; if (is_new (ctx->realpath) || ctx->magic != M_MBOX) unlink(tmppath); @@ -473,4 +470,5 @@ mx_t const compress_mx = { NULL, NULL, NULL, + NULL, };