From: Martin Ling Date: Tue, 29 Dec 2015 02:36:04 +0000 (+0000) Subject: Change debug message to "Port not open" when a closed port is used. X-Git-Tag: libserialport-0.1.1~7 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=8062087ab346852563bf13eef38309c88d520bb7;p=libserialport.git Change debug message to "Port not open" when a closed port is used. Fixes bug #710. --- diff --git a/serialport.c b/serialport.c index 520d27e..c4a0e1b 100644 --- a/serialport.c +++ b/serialport.c @@ -389,12 +389,12 @@ SP_API void sp_free_port_list(struct sp_port **list) #ifdef _WIN32 #define CHECK_PORT_HANDLE() do { \ if (port->hdl == INVALID_HANDLE_VALUE) \ - RETURN_ERROR(SP_ERR_ARG, "Invalid port handle"); \ + RETURN_ERROR(SP_ERR_ARG, "Port not open"); \ } while (0) #else #define CHECK_PORT_HANDLE() do { \ if (port->fd < 0) \ - RETURN_ERROR(SP_ERR_ARG, "Invalid port fd"); \ + RETURN_ERROR(SP_ERR_ARG, "Port not open"); \ } while (0) #endif #define CHECK_OPEN_PORT() do { \