diff --git a/src/BossaWindow.cpp b/src/BossaWindow.cpp index eb046e8e..14584a80 100644 --- a/src/BossaWindow.cpp +++ b/src/BossaWindow.cpp @@ -280,10 +280,12 @@ BossaWindow::OnSerial(wxCommandEvent& event) Samba& samba = wxGetApp().samba; wxString port = _portComboBox->GetString(event.GetSelection()); + errno = 0; + if (!samba.connect(portFactory.create(std::string(port.mb_str())))) { Disconnected(); - Error(wxString::Format(_("Could not connect to device on %s"), port.c_str())); + Error(wxString::Format(_("Could not connect to device on %s: %s"), port.c_str(), strerror(errno))); return; } diff --git a/src/PosixSerialPort.cpp b/src/PosixSerialPort.cpp index 45eaca9c..90e8f9a9 100644 --- a/src/PosixSerialPort.cpp +++ b/src/PosixSerialPort.cpp @@ -32,9 +32,7 @@ #include #include #include -#include #include -#include #include #include