aboutsummaryrefslogtreecommitdiff
path: root/crypto/rand/randfile.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2000-01-23 22:02:34 +0000
committerBodo Möller <bodo@openssl.org>2000-01-23 22:02:34 +0000
commitce052b6c3b18d4ab5f74990d82d09827a6014823 (patch)
treefe70ae167876d6d007358c091f24f0059a55b724 /crypto/rand/randfile.c
parente84c2d267950e9f7c2a210edfee783be84dd83b4 (diff)
downloadopenssl-ce052b6c3b18d4ab5f74990d82d09827a6014823.zip
openssl-ce052b6c3b18d4ab5f74990d82d09827a6014823.tar.gz
openssl-ce052b6c3b18d4ab5f74990d82d09827a6014823.tar.bz2
Under VMS, ftruncate should be available
Diffstat (limited to 'crypto/rand/randfile.c')
-rw-r--r--crypto/rand/randfile.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c
index 1882d7d..375c339 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: