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

Greg A. Woods woods at planix.com
Thu Mar 8 23:21:31 UTC 2012


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)) {
-- 
1.7.9.2




More information about the Nut-upsdev mailing list