Hi,
On 25/11 07:15, Adrien Grellier wrote:
> apcaccess is not working on raspberry pi : it always respond as if -h
> option was given.
I can confirm that the issue is reproducible on asachi.debian.org (armhf):
(sid_armhf-dchroot)ema@asachi:~$ /sbin/apcaccess
Usage: apcaccess [-f <config-file>] [-h <host>[:<port>]] [-p
<parameter-name>] [-u] [<command>] [<host>[:<port>]]
-f Load default host,port from given conf file (default:
/etc/apcupsd/apcupsd.conf)
-h Connect to host and port (supercedes conf file)
-p Return only the value of the named parameter rather than all
parameters and values
-u Strip unit labels
Supported commands: 'status' (default)
Trailing host/port spec overrides -h and conf file.
And that the proposed patch fixes the bug:
(sid_armhf-dchroot)ema@asachi:~$ ./x/sbin/apcaccess
APC : 001,017,0437
DATE : 2015-04-10 20:51:16 +0000
HOSTNAME : asachi
[...]
--- apcupsd-3.14.12.orig/src/apcaccess.c
+++ apcupsd-3.14.12/src/apcaccess.c
@@ -146,7 +146,7 @@
#endif
// Process standard options
- char ch;
+ int ch;
while ((ch = getopt(argc, argv, "f:h:p:u")) != -1)
{
switch (ch)
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]