summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2023-03-27 16:23:55 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-03-27 16:23:55 -0700
commit017d1deaf923887df74b068c33d080008b0c25cf (patch)
treebcad23225bd375fc07f11175a44e987037b399ac
parent35eb34a9513467a88bf5e59f5cb44beb993753db (diff)
downloadxorg-lib-libXmu-017d1deaf923887df74b068c33d080008b0c25cf.tar.gz
XmuReadBitmapDataFromFile: set close-on-exec when opening filesHEADmaster
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/RdBitF.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/RdBitF.c b/src/RdBitF.c
index df379c5..eb60844 100644
--- a/src/RdBitF.c
+++ b/src/RdBitF.c
@@ -59,6 +59,12 @@ in this Software without prior written authorization from The Open Group.
#include <direct.h> /* for _getdrives() */
#endif
+#ifdef O_CLOEXEC
+#define FOPEN_CLOEXEC "e"
+#else
+#define FOPEN_CLOEXEC ""
+#endif
+
#define MAX_SIZE 255
/*
@@ -384,7 +390,7 @@ XmuReadBitmapDataFromFile(_Xconst char *filename, unsigned int *width,
FILE *fstream;
int status;
- if ((fstream = fopen_file (filename, "r")) == NULL) {
+ if ((fstream = fopen_file (filename, "r" FOPEN_CLOEXEC)) == NULL) {
return BitmapOpenFailed;
}
status = XmuReadBitmapData(fstream, width, height, datap, x_hot, y_hot);