mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-03 04:22:47 -05:00
Improve serial-port setup error messages.
Now you can see exactly what pathname the backend tried to open for the serial port, and what error code it got back from the OS when it tried. That should help users distinguish between (for example) a permissions problem and a typo in the filename.
This commit is contained in:
@ -268,7 +268,7 @@ static char *serial_configure(Serial *serial, Conf *conf)
|
||||
options.c_cc[VTIME] = 0;
|
||||
|
||||
if (tcsetattr(serial->fd, TCSANOW, &options) < 0)
|
||||
return dupstr("Unable to configure serial port");
|
||||
return dupprintf("Configuring serial port: %s", strerror(errno));
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -308,7 +308,8 @@ static char *serial_init(const BackendVtable *vt, Seat *seat,
|
||||
|
||||
serial->fd = open(line, O_RDWR | O_NOCTTY | O_NDELAY | O_NONBLOCK);
|
||||
if (serial->fd < 0)
|
||||
return dupstr("Unable to open serial port");
|
||||
return dupprintf("Opening serial port '%s': %s",
|
||||
line, strerror(errno));
|
||||
|
||||
cloexec(serial->fd);
|
||||
|
||||
|
Reference in New Issue
Block a user