summaryrefslogtreecommitdiffstats
path: root/bin/sh/main.c
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2013-05-05 10:51:40 +0000
committerjilles <jilles@FreeBSD.org>2013-05-05 10:51:40 +0000
commit135786413b1346f647980e2c338087f41e2735a2 (patch)
treedaf1ba66bada98a9f310e8dfed5331cec9dd46cd /bin/sh/main.c
parent42b8c0012b80efc0b1d1bacb9d5c45afd8a51301 (diff)
downloadFreeBSD-src-135786413b1346f647980e2c338087f41e2735a2.zip
FreeBSD-src-135786413b1346f647980e2c338087f41e2735a2.tar.gz
sh: Use O_CLOEXEC and F_DUPFD_CLOEXEC instead of separate fcntl() call.
Diffstat (limited to 'bin/sh/main.c')
-rw-r--r--bin/sh/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/sh/main.c b/bin/sh/main.c
index 84a1ef2..ffe8a61 100644
--- a/bin/sh/main.c
+++ b/bin/sh/main.c
@@ -248,7 +248,7 @@ read_profile(const char *name)
if (expandedname == NULL)
return;
INTOFF;
- if ((fd = open(expandedname, O_RDONLY)) >= 0)
+ if ((fd = open(expandedname, O_RDONLY | O_CLOEXEC)) >= 0)
setinputfd(fd, 1);
INTON;
if (fd < 0)
OpenPOWER on IntegriCloud