[Nut-upsdev] [PATCH 20/36] Don't die when tcgetattr() reports different settings on the port.

Arnaud Quette aquette.dev at gmail.com
Mon May 14 13:28:23 UTC 2012


2012/3/9 Greg A. Woods <woods at planix.com>:
> From: "Greg A. Woods" <woods at planix.com>
>
> On Mac OS X with a generic PL2303 USB to serial adapter this seems to
> always be the case, but the communications work A-OK so just log a
> notice about it.
> ---
>  drivers/apcsmart.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/apcsmart.c b/drivers/apcsmart.c
> index b08918c..573983e 100644
> --- a/drivers/apcsmart.c
> +++ b/drivers/apcsmart.c
> @@ -224,7 +224,7 @@ static void apc_ser_set(void)
>        if (tcgetattr(upsfd, &tio_chk))
>                fatal_with_errno(EXIT_FAILURE, "tcgetattr(%s)", device_path);
>        if (memcmp(&tio_chk, &tio, sizeof(tio)))
> -               upslogx(LOG_ERR, "WARNING: unable to set /all/ required attributes (%s)", device_path);
> +               upslogx(LOG_NOTICE, "%s: device reports different attributes than what were set", device_path);
>
>        cable = getval("cable");
>        if (cable && !strcasecmp(cable, ALT_CABLE_1)) {

applied to trunk, r3585, with a driver version bump.
thanks.

Arnaud
-- 
Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://www.debian.org
Free Software Developer - http://arnaud.quette.free.fr/



More information about the Nut-upsdev mailing list