Simplify serial_open

* src/sysdep.c (serial_open): On failure, simply return -1
and set errno; do not call report_file_error, as the
caller is supposed to do that if needed.
This commit is contained in:
Paul Eggert 2026-05-19 09:06:37 -07:00
parent b3b3e203cc
commit fe33900747

View file

@ -2980,10 +2980,9 @@ int
serial_open (Lisp_Object port)
{
int fd = emacs_open (SSDATA (port), O_RDWR | O_NOCTTY | O_NONBLOCK, 0);
if (fd < 0)
report_file_error ("Opening serial port", port);
#ifdef TIOCEXCL
ioctl (fd, TIOCEXCL, (char *) 0);
if (0 <= fd)
ioctl (fd, TIOCEXCL, (char *) 0);
#endif
return fd;