Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/libexec/mail.local Fix error checks in open(2) calls.
details: https://anonhg.NetBSD.org/src/rev/5aa230394020
branches: trunk
changeset: 346606:5aa230394020
user: shm <shm%NetBSD.org@localhost>
date: Thu Jul 21 12:29:37 2016 +0000
description:
Fix error checks in open(2) calls.
diffstat:
libexec/mail.local/mail.local.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diffs (31 lines):
diff -r 6f329f3d309e -r 5aa230394020 libexec/mail.local/mail.local.c
--- a/libexec/mail.local/mail.local.c Thu Jul 21 12:24:54 2016 +0000
+++ b/libexec/mail.local/mail.local.c Thu Jul 21 12:29:37 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mail.local.c,v 1.27 2016/07/19 13:11:38 shm Exp $ */
+/* $NetBSD: mail.local.c,v 1.28 2016/07/21 12:29:37 shm Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -36,7 +36,7 @@
#if 0
static char sccsid[] = "@(#)mail.local.c 8.22 (Berkeley) 6/21/95";
#else
-__RCSID("$NetBSD: mail.local.c,v 1.27 2016/07/19 13:11:38 shm Exp $");
+__RCSID("$NetBSD: mail.local.c,v 1.28 2016/07/21 12:29:37 shm Exp $");
#endif
#endif /* not lint */
@@ -218,10 +218,10 @@
}
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;
Home |
Main Index |
Thread Index |
Old Index