提交 ce052b6c 编写于 作者: B Bodo Möller

Under VMS, ftruncate should be available

上级 e84c2d26
...@@ -162,6 +162,13 @@ int RAND_write_file(const char *file) ...@@ -162,6 +162,13 @@ int RAND_write_file(const char *file)
ret+=i; ret+=i;
if (n <= 0) break; if (n <= 0) break;
} }
#ifdef VMS
/* We may have updated an existing file using mode "rb+",
* now remove any old extra bytes */
if (ret > 0)
ftruncate(fileno(out), ret);
#endif
fclose(out); fclose(out);
memset(buf,0,BUFSIZE); memset(buf,0,BUFSIZE);
err: err:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册