summaryrefslogtreecommitdiff
path: root/src/TextPop.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/TextPop.c')
-rw-r--r--src/TextPop.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/TextPop.c b/src/TextPop.c
index 6407c98..d47fbd4 100644
--- a/src/TextPop.c
+++ b/src/TextPop.c
@@ -68,6 +68,11 @@ in this Software without prior written authorization from the X Consortium.
#include <X11/Xos.h> /* for O_RDONLY */
#include <errno.h>
+#ifdef O_CLOEXEC
+#define FOPEN_CLOEXEC "e"
+#else
+#define FOPEN_CLOEXEC ""
+#endif
#define INSERT_FILE ("Enter Filename:")
@@ -274,7 +279,7 @@ InsertFileNamed(Widget tw, char *str)
XawTextPosition pos;
if ( (str == NULL) || (strlen(str) == 0) ||
- ((file = fopen(str, "r")) == NULL))
+ ((file = fopen(str, "r" FOPEN_CLOEXEC)) == NULL))
return(FALSE);
pos = XawTextGetInsertionPoint(tw);