summaryrefslogtreecommitdiff
path: root/Build/source/texk/lcdf-typetools/otftotfm/automatic.cc
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/lcdf-typetools/otftotfm/automatic.cc')
-rw-r--r--Build/source/texk/lcdf-typetools/otftotfm/automatic.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/Build/source/texk/lcdf-typetools/otftotfm/automatic.cc b/Build/source/texk/lcdf-typetools/otftotfm/automatic.cc
index 9e46907eb46..35b3e92a081 100644
--- a/Build/source/texk/lcdf-typetools/otftotfm/automatic.cc
+++ b/Build/source/texk/lcdf-typetools/otftotfm/automatic.cc
@@ -601,14 +601,16 @@ update_autofont_map(const String &fontname, String mapline, ErrorHandler *errh)
// rewind file
#if HAVE_FTRUNCATE
rewind(f);
- ftruncate(fd, 0);
-#else
- fclose(f);
- f = fopen(map_file.c_str(), "w");
+ if (ftruncate(fd, 0) < 0)
#endif
+ {
+ fclose(f);
+ f = fopen(map_file.c_str(), "w");
+ fd = fileno(f);
+ }
// write data
- fwrite(text.data(), 1, text.length(), f);
+ ignore_result(fwrite(text.data(), 1, text.length(), f));
fclose(f);