From 235a5f716d91a1844af1c27e968e107921fa5215 Mon Sep 17 00:00:00 2001 From: Ben Moyer Date: Sat, 13 Jan 2018 12:16:50 -0800 Subject: [PATCH] print GetLastError() result instead of errno (#154) --- src/impl/win.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/impl/win.cc b/src/impl/win.cc index 4bc2f66..786f4f6 100644 --- a/src/impl/win.cc +++ b/src/impl/win.cc @@ -74,15 +74,15 @@ Serial::SerialImpl::open () 0); if (fd_ == INVALID_HANDLE_VALUE) { - DWORD errno_ = GetLastError(); + DWORD create_file_err = GetLastError(); stringstream ss; - switch (errno_) { + switch (create_file_err) { case ERROR_FILE_NOT_FOUND: // Use this->getPort to convert to a std::string ss << "Specified port, " << this->getPort() << ", does not exist."; THROW (IOException, ss.str().c_str()); default: - ss << "Unknown error opening the serial port: " << errno; + ss << "Unknown error opening the serial port: " << create_file_err; THROW (IOException, ss.str().c_str()); } }