Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/mail add O_CLOEXEC



details:   https://anonhg.NetBSD.org/src/rev/c5ebf3a1fc6e
branches:  trunk
changeset: 959541:c5ebf3a1fc6e
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Feb 17 21:09:39 2021 +0000

description:
add O_CLOEXEC

diffstat:

 usr.bin/mail/dotlock.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 046dc5eef857 -r c5ebf3a1fc6e usr.bin/mail/dotlock.c
--- a/usr.bin/mail/dotlock.c    Wed Feb 17 17:43:09 2021 +0000
+++ b/usr.bin/mail/dotlock.c    Wed Feb 17 21:09:39 2021 +0000
@@ -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 @@
         * 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;



Home | Main Index | Thread Index | Old Index