Package: bsd-mailx / 8.1.2-0.20141216cvs-2

06-Use-lockf-instead-of-flock.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
From: Robert Luberda <robert@debian.org>
Date: Tue, 5 Jun 2001 23:08:00 +0200
Subject: 06 Use lockf instead of flock.

quit.c: Use lockf instead if flock.
---
 quit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/quit.c b/quit.c
index 5621637..0274b2c 100644
--- a/quit.c
+++ b/quit.c
@@ -96,7 +96,7 @@ quit(void)
 	fbuf = Fopen(mailname, "r+");
 	if (fbuf == NULL)
 		goto newmail;
-	if (flock(fileno(fbuf), LOCK_EX) == -1) {
+	if (lockf(fileno(fbuf), F_LOCK, 0) == -1) {
 		warn("Unable to lock mailbox");
 		(void)Fclose(fbuf);
 		return(-1);