Module Name: src
Committed By: christos
Date: Wed Feb 17 21:09:39 UTC 2021
Modified Files:
src/usr.bin/mail: dotlock.c
Log Message:
add O_CLOEXEC
To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/mail/dotlock.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/mail/dotlock.c
diff -u src/usr.bin/mail/dotlock.c:1.13 src/usr.bin/mail/dotlock.c:1.14
--- src/usr.bin/mail/dotlock.c:1.13 Sat Jul 4 18:45:08 2015
+++ src/usr.bin/mail/dotlock.c Wed Feb 17 16:09:39 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: dotlock.c,v 1.13 2015/07/04 22:45:08 christos Exp $ */
+/* $NetBSD: dotlock.c,v 1.14 2021/02/17 21:09:39 christos Exp $ */
/*
* Copyright (c) 1996 Christos Zoulas. All rights reserved.
@@ -26,7 +26,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: dotlock.c,v 1.13 2015/07/04 22:45:08 christos Exp $");
+__RCSID("$NetBSD: dotlock.c,v 1.14 2021/02/17 21:09:39 christos Exp $");
#endif
#include "rcv.h"
@@ -81,7 +81,8 @@ create_exclusive(const char *fname)
* We try to create the unique filename.
*/
for (ntries = 0; ; ntries++) {
- fd = open(path, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_SYNC, 0);
+ fd = open(path,
+ O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_SYNC|O_CLOEXEC, 0);
if (fd != -1) {
(void)close(fd);
break;