Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornmittler <nathanmittler@google.com>2016-05-19 18:49:59 +0300
committerDavid Benjamin <davidben@google.com>2016-05-19 23:30:50 +0300
commitf0322b2abce91458f62db44dc6b777fc5e0323d9 (patch)
treec08da438a21003619cf4dd187fd5d2196a386fc3 /tool/digest.cc
parente09e579603bf7d05b5160bb9bd53eacea6cff47d (diff)
Use non-deprecated methods on windows.
Use of strdup, close, lseek, read, and write prevent linking statically againt libcmt.lib. Change-Id: I04f7876ec0f03f29f000bbcc6b2ccdec844452d2 Reviewed-on: https://boringssl-review.googlesource.com/8010 Reviewed-by: David Benjamin <davidben@google.com>
Diffstat (limited to 'tool/digest.cc')
-rw-r--r--tool/digest.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/tool/digest.cc b/tool/digest.cc
index 012202ce..c2cee7fb 100644
--- a/tool/digest.cc
+++ b/tool/digest.cc
@@ -46,7 +46,7 @@ typedef int ssize_t;
struct close_delete {
void operator()(int *fd) {
- close(*fd);
+ BORINGSSL_CLOSE(*fd);
}
};
@@ -83,7 +83,7 @@ static const char kStdinName[] = "standard input";
static bool OpenFile(int *out_fd, const std::string &filename) {
*out_fd = -1;
- int fd = open(filename.c_str(), O_RDONLY | O_BINARY);
+ int fd = BORINGSSL_OPEN(filename.c_str(), O_RDONLY | O_BINARY);
if (fd < 0) {
fprintf(stderr, "Failed to open input file '%s': %s\n", filename.c_str(),
strerror(errno));
@@ -146,7 +146,7 @@ static bool SumFile(std::string *out_hex, const EVP_MD *md,
ssize_t n;
do {
- n = read(fd, buf.get(), kBufSize);
+ n = BORINGSSL_READ(fd, buf.get(), kBufSize);
} while (n == -1 && errno == EINTR);
if (n == 0) {
@@ -234,10 +234,10 @@ static bool Check(const CheckModeArguments &args, const EVP_MD *md,
return false;
}
- file = fdopen(fd, "rb");
+ file = BORINGSSL_FDOPEN(fd, "rb");
if (!file) {
perror("fdopen");
- close(fd);
+ BORINGSSL_CLOSE(fd);
return false;
}