diff options
author | Christos Zoulas <christos@NetBSD.org> | 2015-02-25 21:39:30 +0100 |
---|---|---|
committer | Mike DePaulo <mikedep333@gmail.com> | 2015-03-28 13:05:45 -0400 |
commit | 7e5f8b1f5a3cb6c7c9f784900f3b0b23215441bb (patch) | |
tree | 3752390fc1e1b8c1aea7fa65ea0ce62ca003e2e5 /libXfont/src/fontfile/fileio.c | |
parent | e86de31f7d90b7258bc143a4feaf29ee55b7db79 (diff) | |
download | vcxsrv-7e5f8b1f5a3cb6c7c9f784900f3b0b23215441bb.tar.gz vcxsrv-7e5f8b1f5a3cb6c7c9f784900f3b0b23215441bb.tar.bz2 vcxsrv-7e5f8b1f5a3cb6c7c9f784900f3b0b23215441bb.zip |
Set close-on-exec for font file I/O.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
(cherry picked from commit d9fda3d247942292a5f24694c22337c547006e11)
Diffstat (limited to 'libXfont/src/fontfile/fileio.c')
-rw-r--r-- | libXfont/src/fontfile/fileio.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libXfont/src/fontfile/fileio.c b/libXfont/src/fontfile/fileio.c index 80af51193..d44cecdc4 100644 --- a/libXfont/src/fontfile/fileio.c +++ b/libXfont/src/fontfile/fileio.c @@ -36,6 +36,9 @@ in this Software without prior written authorization from The Open Group. #ifndef O_BINARY #define O_BINARY O_RDONLY #endif +#ifndef O_CLOEXEC +#define O_CLOEXEC 0 +#endif FontFilePtr FontFileOpen (const char *name) @@ -44,7 +47,7 @@ FontFileOpen (const char *name) int len; BufFilePtr raw, cooked; - fd = open (name, O_BINARY); + fd = open (name, O_BINARY|O_CLOEXEC); if (fd < 0) return 0; raw = BufFileOpenRead (fd); |