From f295c5224e8e8ce01d5f2014e82f433bb2d029c0 Mon Sep 17 00:00:00 2001 From: Philip Guenther Date: Mon, 15 Sep 2014 06:15:49 +0000 Subject: When fopen()ing internal to libc (the API doesn't support the use of the resulting FILE *), then pass fopen() the 'e' mode letter to mark it close-on-exec. ok miod@ --- lib/libc/gen/fstab.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libc/gen/fstab.c') diff --git a/lib/libc/gen/fstab.c b/lib/libc/gen/fstab.c index 379152bd5f0..bb757341144 100644 --- a/lib/libc/gen/fstab.c +++ b/lib/libc/gen/fstab.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fstab.c,v 1.19 2013/06/01 01:42:55 tedu Exp $ */ +/* $OpenBSD: fstab.c,v 1.20 2014/09/15 06:15:48 guenther Exp $ */ /* * Copyright (c) 1980, 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -196,7 +196,7 @@ setfsent(void) goto fail; } - if ((_fs_fp = fopen(_PATH_FSTAB, "r"))) + if ((_fs_fp = fopen(_PATH_FSTAB, "re"))) return(1); fail: -- cgit v1.2.3