Module Name:    src
Committed By:   martin
Date:           Thu Jul 21 12:54:09 UTC 2016

Modified Files:
        src/libexec/mail.local [netbsd-7]: mail.local.c

Log Message:
Pull up following revision(s) (requested by shm in ticket #1207):
        libexec/mail.local/mail.local.c: revision 1.28
Fix error checks in open(2) calls.


To generate a diff of this commit:
cvs rdiff -u -r1.26.20.1 -r1.26.20.2 src/libexec/mail.local/mail.local.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/mail.local/mail.local.c
diff -u src/libexec/mail.local/mail.local.c:1.26.20.1 src/libexec/mail.local/mail.local.c:1.26.20.2
--- src/libexec/mail.local/mail.local.c:1.26.20.1	Tue Jul 19 14:08:19 2016
+++ src/libexec/mail.local/mail.local.c	Thu Jul 21 12:54:09 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: mail.local.c,v 1.26.20.1 2016/07/19 14:08:19 martin Exp $	*/
+/*	$NetBSD: mail.local.c,v 1.26.20.2 2016/07/21 12:54:09 martin Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -36,7 +36,7 @@ __COPYRIGHT("@(#) Copyright (c) 1990, 19
 #if 0
 static char sccsid[] = "@(#)mail.local.c	8.22 (Berkeley) 6/21/95";
 #else
-__RCSID("$NetBSD: mail.local.c,v 1.26.20.1 2016/07/19 14:08:19 martin Exp $");
+__RCSID("$NetBSD: mail.local.c,v 1.26.20.2 2016/07/21 12:54:09 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -218,10 +218,10 @@ deliver(int fd, char *name, int lockfile
 	}
 	
 	if ((mbfd = open(path, O_APPEND|O_WRONLY|O_EXLOCK,
-	    S_IRUSR|S_IWUSR)) != -1) {
+	    S_IRUSR|S_IWUSR)) == -1) {
 		/* create file */
 		if ((mbfd = open(path, O_APPEND|O_CREAT|O_WRONLY|O_EXLOCK,
-		    S_IRUSR|S_IWUSR)) != -1) {
+		    S_IRUSR|S_IWUSR)) == -1) {
 			logwarn("%s: %s", path, strerror(errno));
 			rval = EX_OSERR;
 			goto bad;

Reply via email to