From: Bodo Möller Date: Sun, 23 Jan 2000 22:02:34 +0000 (+0000) Subject: Under VMS, ftruncate should be available X-Git-Tag: OpenSSL_0_9_5beta1~211 X-Git-Url: https://git.openssl.org/?p=openssl.git;a=commitdiff_plain;h=ce052b6c3b18d4ab5f74990d82d09827a6014823 Under VMS, ftruncate should be available --- diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c index 1882d7df2c..375c339e5c 100644 --- a/crypto/rand/randfile.c +++ b/crypto/rand/randfile.c @@ -162,6 +162,13 @@ int RAND_write_file(const char *file) ret+=i; 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); memset(buf,0,BUFSIZE); err: