+/*
+ * The 'e' modifier for O_CLOEXEC is glibc >= 2.7 only, hence not
+ * portable, so provide an own wrapper for this functionality.
+ */
+static FILE *fopen_cloexec_rdonly(const char *pathname)
+{
+ int fd;
+ if ((fd = open(pathname, O_RDONLY | O_CLOEXEC)) < 0)
+ return NULL;
+ return fdopen(fd, "r");
+}
+