Package: cutecom
Version: 0.22.0-2

When opening one of the serial ports fails, you only get the error that it
failed but not why, which is frustrating and not helpful. The typical faults
are that a port isn't there or that you don't have access permissions. The
following piece of code changes the error handling after open() so that the
actual error becomes available to the user:

   m_fd=open(dev.toLatin1(), flags | O_NDELAY);
   if (m_fd<0)
   {
      int e = errno;
      char* es = strerror(e);
      std::cerr<<"opening failed with errno=" << e << "(" << es << ")" 
<<std::endl;
      m_fd=-1;
      QMessageBox::information(this, tr("Error"),
                               tr("Could not open %1:\n error #%2 
(%3)").arg(dev).arg(e).arg(es));
      return;
   }


Cheers!

Uli


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to