summaryrefslogtreecommitdiff
path: root/usr.bin/mail
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2013-04-29 00:28:24 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2013-04-29 00:28:24 +0000
commit893b957ab23fe3eb2386c9acedd396606f76b5cb (patch)
treeef352fdb5afd940f9c19549bb1e8a4986357e87b /usr.bin/mail
parent8656f10462f9b7ede2d214dc09969c2fa153b626 (diff)
use FD_CLOEXEC instead of 1; from David Hill
ok otto
Diffstat (limited to 'usr.bin/mail')
-rw-r--r--usr.bin/mail/lex.c6
-rw-r--r--usr.bin/mail/names.c4
-rw-r--r--usr.bin/mail/popen.c10
3 files changed, 10 insertions, 10 deletions
diff --git a/usr.bin/mail/lex.c b/usr.bin/mail/lex.c
index 7690ce78330..ba19d21a2ab 100644
--- a/usr.bin/mail/lex.c
+++ b/usr.bin/mail/lex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lex.c,v 1.34 2011/04/06 11:36:26 miod Exp $ */
+/* $OpenBSD: lex.c,v 1.35 2013/04/29 00:28:23 okan Exp $ */
/* $NetBSD: lex.c,v 1.10 1997/05/17 19:55:13 pk Exp $ */
/*
@@ -129,10 +129,10 @@ setfile(char *name)
if ((fd = mkstemp(tempname)) == -1 ||
(otf = fdopen(fd, "w")) == NULL)
err(1, "%s", tempname);
- (void)fcntl(fileno(otf), F_SETFD, 1);
+ (void)fcntl(fileno(otf), F_SETFD, FD_CLOEXEC);
if ((itf = fopen(tempname, "r")) == NULL)
err(1, "%s", tempname);
- (void)fcntl(fileno(itf), F_SETFD, 1);
+ (void)fcntl(fileno(itf), F_SETFD, FD_CLOEXEC);
(void)rm(tempname);
setptr(ibuf, (off_t)0);
setmsize(msgCount);
diff --git a/usr.bin/mail/names.c b/usr.bin/mail/names.c
index e4f9caeafe2..7c0e9e0eef3 100644
--- a/usr.bin/mail/names.c
+++ b/usr.bin/mail/names.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: names.c,v 1.18 2009/10/27 23:59:40 deraadt Exp $ */
+/* $OpenBSD: names.c,v 1.19 2013/04/29 00:28:23 okan Exp $ */
/* $NetBSD: names.c,v 1.5 1996/06/08 19:48:32 christos Exp $ */
/*
@@ -248,7 +248,7 @@ outof(struct name *names, FILE *fo, struct header *hp)
(void)Fclose(fout);
goto cant;
}
- (void)fcntl(image, F_SETFD, 1);
+ (void)fcntl(image, F_SETFD, FD_CLOEXEC);
fprintf(fout, "From %s %s", myname, date);
puthead(hp, fout, GTO|GSUBJECT|GCC|GNL);
while ((c = getc(fo)) != EOF)
diff --git a/usr.bin/mail/popen.c b/usr.bin/mail/popen.c
index ce4fb118e11..5a1cd561ef1 100644
--- a/usr.bin/mail/popen.c
+++ b/usr.bin/mail/popen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: popen.c,v 1.35 2009/10/27 23:59:40 deraadt Exp $ */
+/* $OpenBSD: popen.c,v 1.36 2013/04/29 00:28:23 okan Exp $ */
/* $NetBSD: popen.c,v 1.6 1997/05/13 06:48:42 mikel Exp $ */
/*
@@ -69,7 +69,7 @@ Fopen(char *file, char *mode)
if ((fp = fopen(file, mode)) != NULL) {
register_file(fp, 0, 0);
- (void)fcntl(fileno(fp), F_SETFD, 1);
+ (void)fcntl(fileno(fp), F_SETFD, FD_CLOEXEC);
}
return(fp);
}
@@ -81,7 +81,7 @@ Fdopen(int fd, char *mode)
if ((fp = fdopen(fd, mode)) != NULL) {
register_file(fp, 0, 0);
- (void)fcntl(fileno(fp), F_SETFD, 1);
+ (void)fcntl(fileno(fp), F_SETFD, FD_CLOEXEC);
}
return(fp);
}
@@ -105,8 +105,8 @@ Popen(char *cmd, char *mode)
if (pipe(p) < 0)
return(NULL);
- (void)fcntl(p[READ], F_SETFD, 1);
- (void)fcntl(p[WRITE], F_SETFD, 1);
+ (void)fcntl(p[READ], F_SETFD, FD_CLOEXEC);
+ (void)fcntl(p[WRITE], F_SETFD, FD_CLOEXEC);
if (*mode == 'r') {
myside = p[READ];
hisside = fd0 = fd1 = p[WRITE];