Skip to content
This repository was archived by the owner on Oct 5, 2021. It is now read-only.

Commit 67c2f53

Browse files
committed
w32: Print error message on missing serial port
This was commented on in: http://code.google.com/p/stm32flash/issues/detail?id=16 Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
1 parent 66a19e1 commit 67c2f53

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

serial_w32.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,11 @@ serial_t* serial_open(const char *device)
6767
if (devName != device)
6868
free(devName);
6969

70-
if(h->fd == INVALID_HANDLE_VALUE)
70+
if (h->fd == INVALID_HANDLE_VALUE) {
71+
if (GetLastError() == ERROR_FILE_NOT_FOUND)
72+
fprintf(stderr, "File not found: %s\n", device);
7173
return NULL;
74+
}
7275

7376
SetupComm(h->fd, 4096, 4096); /* Set input and output buffer size */
7477

0 commit comments

Comments
 (0)