From ce052b6c3b18d4ab5f74990d82d09827a6014823 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bodo=20M=C3=B6ller?= Date: Sun, 23 Jan 2000 22:02:34 +0000 Subject: [PATCH] Under VMS, ftruncate should be available --- crypto/rand/randfile.c | 7 +++++++ 1 file changed, 7 insertions(+) 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: -- 2.25.1