commit 8ea2c22a4c08c90d0292d1ba374aeb9f5f0a413c Author: Christian Persch Date: Sat Aug 18 19:42:31 2018 +0200 Open files with O_CLOEXEC diff --git a/libspectre/spectre-document.c b/libspectre/spectre-document.c index 6e49350..eff52da 100644 --- a/libspectre/spectre-document.c +++ b/libspectre/spectre-document.c @@ -118,7 +118,7 @@ spectre_document_load (SpectreDocument *document, return; } - file = fopen (filename, "rb"); + file = fopen (filename, "rbe"); spectre_document_load_internal (document, filename, file); } @@ -483,7 +483,7 @@ spectre_document_save (SpectreDocument *document, _spectre_return_if_fail (document != NULL); _spectre_return_if_fail (filename != NULL); - to = fopen (filename, "wb"); + to = fopen (filename, "wbe"); spectre_document_save_internal (document, to); } diff --git a/libspectre/spectre-exporter-ps.c b/libspectre/spectre-exporter-ps.c index 4f813ee..8e54059 100644 --- a/libspectre/spectre-exporter-ps.c +++ b/libspectre/spectre-exporter-ps.c @@ -49,7 +49,7 @@ spectre_exporter_ps_begin_filename (SpectreExporter *exporter, { FILE *to; - to = fopen (filename, "wb"); + to = fopen (filename, "wbe"); return spectre_exporter_ps_begin_file (exporter, to); } diff --git a/libspectre/spectre-gs.c b/libspectre/spectre-gs.c index 61192e6..5bdd3c8 100644 --- a/libspectre/spectre-gs.c +++ b/libspectre/spectre-gs.c @@ -160,7 +160,7 @@ spectre_gs_process (SpectreGS *gs, FILE *file; int rv; - file = fopen (filename, "rb"); + file = fopen (filename, "rbe"); if (!file) return FALSE;