Package: mew-beta / 7.0.50~6.8+0.20190228-1

040_incm-lock.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Subject: Don't unlock when incm can't get lock
From: YAMANAKA Hitoshi <zinn@nifty.com>, Tatsuya Kinoshita <tats@debian.org>

cf. https://github.com/kazu-yamamoto/Mew/pull/113

diff --git a/bin/incm.c b/bin/incm.c
index 04558d3..fb07f57 100644
--- a/bin/incm.c
+++ b/bin/incm.c
@@ -630,8 +630,12 @@ lock_mbox(char *lockfile)
 				return 1; /* doesn't need a lockfile, maybe. */
 			else if (errno != EEXIST)
 				error("open(%s)", lockfile);
-			if (retry-- <= 0)
-				error("can't get lock(%s)", lockfile);
+			if (retry-- <= 0) {
+				char buf[PATH_MAX];
+				STRCPY(buf, lockfile);
+				MboxLock[0] = '\0'; /* no unlinking lockfile */
+				error("can't get lock(%s)", buf);
+			}
 		}
 		else {
 			/* lock succeeded. */