Commit d62d7d51 authored by Lev Walkin's avatar Lev Walkin

ftruncate output should not be ignored under some compilers

parent 47d884c7
......@@ -95,7 +95,12 @@ asn1c_open_file(const char *name, const char *ext, char **opt_tmpname) {
return NULL;
}
(void)ftruncate(fd, 0);
if(ftruncate(fd, 0) == -1) {
fprintf(stderr, "%s: ftruncate failed: %s\n",
fname, strerror(errno));
if(created) unlink(fname);
return NULL;
}
#else
_chsize(fd, 0);
#endif /* _WIN32 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment