]> sigrok.org Git - libserialport.git/commitdiff
Change debug message to "Port not open" when a closed port is used.
authorMartin Ling <redacted>
Tue, 29 Dec 2015 02:36:04 +0000 (02:36 +0000)
committerUwe Hermann <redacted>
Tue, 29 Dec 2015 12:30:30 +0000 (13:30 +0100)
Fixes bug #710.

serialport.c

index 520d27e8531a4014e6a9746f9bd25b5d2b91103b..c4a0e1b96e5dbc50e6754fcc55c48fa8c26822e7 100644 (file)
@@ -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 { \