The close at exit specifier "e" is glibc extension, so use it only if when
the extension is available.
Proposed-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
DBG(dbgprint("reading %s", file));
- if (!(fp = fopen(file, "re")))
+ if (!(fp = fopen(file, "r" UL_CLOEXECSTR)))
return NULL;
len = getline(&ret, &dummy, fp);
if (len >= 0) {
DBG(dbgprint("trying /proc"));
- fc = fopen("/proc/consoles", "re");
+ fc = fopen("/proc/consoles", "r" UL_CLOEXECSTR);
if (!fc) {
rc = 2;
goto done;