[Nut-upsdev] svn commit r2732

John Bayly freebsd.ports at tipstrade.net
Mon Dec 13 13:13:41 UTC 2010

I've discovered an issue (which may be unique to my UPS) with this commit.
init_communication now returns -1, instead of 0 if it failed to read the 
manufacturer info, this makes sense after all.

With my UPS (Belkin F6C1400-EUR), the response to the Manufacturer 
command returns only 6 spaces (rather than "BELKIN"), this means that 
init_communications fails, and the driver fails with EXIT_FAILURE
This has only become apparent with this commit due to the change in 
return code. I've added extra debugging to the previous version of the 
driver and have seen that the Manufacturer command returns 6 spaces too.

Looking at the previous version, it appears that it was made to return 
failure only if the actual read failed. It's a bit difficult to tell if 
this was by design or simply a bug. All I can say for sure is that it's 
been there since v.0.21 (commit r2).

More information about the Nut-upsdev mailing list