diff --git a/ChangeLog b/ChangeLog index 748d43b9..20f50a1f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-01-08 Joerg Wunsch + + Submitted by Gerard: + patch #6828: Using arbitrary BAUD rates + * ser_posix.c (serial_baud_lookup): Allow non-standard baud + rates. + * ser_win32.c (serial_baud_lookup): (Dito.) + 2010-01-07 Joerg Wunsch Submitted by Eric Trein: diff --git a/ser_posix.c b/ser_posix.c index 751738eb..a37e5290 100644 --- a/ser_posix.c +++ b/ser_posix.c @@ -81,9 +81,15 @@ static speed_t serial_baud_lookup(long baud) map++; } - fprintf(stderr, "%s: serial_baud_lookup(): unknown baud rate: %ld\n", - progname, baud); - exit(1); + /* + * If a non-standard BAUD rate is used, issue + * a warning (if we are verbose) and return the raw rate + */ + if (verbose > 0) + fprintf(stderr, "%s: serial_baud_lookup(): Using non-standard baud rate: %ld", + progname, baud); + + return baud; } static int ser_setspeed(union filedescriptor *fd, long baud) diff --git a/ser_win32.c b/ser_win32.c index e68ac1fb..9d8bf7aa 100644 --- a/ser_win32.c +++ b/ser_win32.c @@ -67,9 +67,15 @@ static DWORD serial_baud_lookup(long baud) map++; } - fprintf(stderr, "%s: serial_baud_lookup(): unknown baud rate: %ld", - progname, baud); - exit(1); + /* + * If a non-standard BAUD rate is used, issue + * a warning (if we are verbose) and return the raw rate + */ + if (verbose > 0) + fprintf(stderr, "%s: serial_baud_lookup(): Using non-standard baud rate: %ld", + progname, baud); + + return baud; }