diff -urNap sendmail-8.14.4.orig/mail.local/mail.local.c sendmail-8.14.4/mail.local/mail.local.c
--- sendmail-8.14.4.orig/mail.local/mail.local.c	2008-02-19 08:13:30.000000000 +0100
+++ sendmail-8.14.4/mail.local/mail.local.c	2012-05-09 10:27:45.201528350 +0200
@@ -100,22 +100,6 @@ SM_IDSTR(id, "@(#)$Id: mail.local.c,v 8.
 #define REALLOC(ptr, size)	(((ptr) == NULL) ? malloc(size) : realloc(ptr, size))
 
 /*
-**  If you don't have flock, you could try using lockf instead.
-*/
-
-#ifdef LDA_USE_LOCKF
-# define flock(a, b)	lockf(a, b, 0)
-# ifdef LOCK_EX
-#  undef LOCK_EX
-# endif /* LOCK_EX */
-# define LOCK_EX	F_LOCK
-#endif /* LDA_USE_LOCKF */
-
-#ifndef LOCK_EX
-# include <sys/file.h>
-#endif /* ! LOCK_EX */
-
-/*
 **  If you don't have setreuid, and you have saved uids, and you have
 **  a seteuid() call that doesn't try to emulate using setuid(), then
 **  you can try defining LDA_USE_SETEUID.
@@ -1095,9 +1079,6 @@ deliver(fd, name)
 	**  can't unlink it.  Historically, binmail set the owner/group at
 	**  each mail delivery.  We no longer do this, assuming that if the
 	**  ownership or permissions were changed there was a reason.
-	**
-	**  XXX
-	**  open(2) should support flock'ing the file.
 	*/
 
 tryagain:
@@ -1265,7 +1246,7 @@ tryagain:
 #endif /* 0 */
 
 	/* Wait until we can get a lock on the file. */
-	if (flock(mbfd, LOCK_EX) < 0)
+	if (lockf(mbfd, F_LOCK, 0) < 0)
 	{
 		mailerr("450 4.2.0", "%s: %s", path, sm_errstring(errno));
 		goto err1;
@@ -1378,7 +1359,7 @@ err0:		(void) setreuid(0, 0);
 		mbfd = open(path, O_WRONLY, 0);
 		if (mbfd < 0 ||
 		    cursize == 0
-		    || flock(mbfd, LOCK_EX) < 0 ||
+		    || lockf(mbfd, F_LOCK, 0) < 0 ||
 		    fstat(mbfd, &sb) < 0 ||
 		    sb.st_size != cursize ||
 		    sb.st_nlink != 1 ||
