diff options
author | Bodo Möller <bodo@openssl.org> | 2000-01-23 22:02:34 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2000-01-23 22:02:34 +0000 |
commit | ce052b6c3b18d4ab5f74990d82d09827a6014823 (patch) | |
tree | fe70ae167876d6d007358c091f24f0059a55b724 /crypto/rand/randfile.c | |
parent | e84c2d267950e9f7c2a210edfee783be84dd83b4 (diff) |
Under VMS, ftruncate should be available
Diffstat (limited to 'crypto/rand/randfile.c')
-rw-r--r-- | crypto/rand/randfile.c | 7 |
1 files changed, 7 insertions, 0 deletions
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: |