summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Marlowe <mattm@gentoo.org>2013-10-21 22:02:02 +0000
committerMatthew Marlowe <mattm@gentoo.org>2013-10-21 22:02:02 +0000
commit47953333f95d68f4fde3a4020ff1b94243bb6349 (patch)
treebb2f72408f2af88dc1a78b5877124ade372c0e02 /sys-power
parentVersion bump. (diff)
downloadhistorical-47953333f95d68f4fde3a4020ff1b94243bb6349.tar.gz
historical-47953333f95d68f4fde3a4020ff1b94243bb6349.tar.bz2
historical-47953333f95d68f4fde3a4020ff1b94243bb6349.zip
Tentative fix for Bug 430894, net-snmp compatibility with apcupsd.
Package-Manager: portage-2.1.12.2/cvs/Linux x86_64 Manifest-Sign-Key: 0x786037A7
Diffstat (limited to 'sys-power')
-rw-r--r--sys-power/apcupsd/ChangeLog8
-rw-r--r--sys-power/apcupsd/Manifest16
-rw-r--r--sys-power/apcupsd/apcupsd-3.14.10-r5.ebuild143
-rw-r--r--sys-power/apcupsd/files/apcupsd-snmp-5.7.2.patch104
4 files changed, 265 insertions, 6 deletions
diff --git a/sys-power/apcupsd/ChangeLog b/sys-power/apcupsd/ChangeLog
index e9c7472e9fff..a77a4a915a43 100644
--- a/sys-power/apcupsd/ChangeLog
+++ b/sys-power/apcupsd/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sys-power/apcupsd
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/ChangeLog,v 1.88 2013/10/21 21:12:15 floppym Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/ChangeLog,v 1.89 2013/10/21 22:01:49 mattm Exp $
+
+*apcupsd-3.14.10-r5 (21 Oct 2013)
+
+ 21 Oct 2013; Matthew Marlowe <mattm@gentoo.org> +apcupsd-3.14.10-r5.ebuild,
+ +files/apcupsd-snmp-5.7.2.patch:
+ Tentative fix for Bug 430894, net-snmp compatibility with apcupsd.
21 Oct 2013; Mike Gilbert <floppym@gentoo.org> apcupsd-3.14.10-r4.ebuild:
Fix util-linux dep.
diff --git a/sys-power/apcupsd/Manifest b/sys-power/apcupsd/Manifest
index 9fdacef8ac74..6f617de8bfda 100644
--- a/sys-power/apcupsd/Manifest
+++ b/sys-power/apcupsd/Manifest
@@ -2,6 +2,7 @@
Hash: SHA256
AUX apcupsd-3.14.9-aliasing.patch 2108 SHA256 21343f4798121a828a89eee49ca9fe7574b2fb45a5aad35fbfd5aabec7740761 SHA512 48eb51385136216d1cdddb6b237b89a52c516b223aa7fe50fb35761cd595d9ab7f7fabbd0e4f8c0f7d45df6feed0a2e240d227181f3d772fc5fa9f8bfa62529f WHIRLPOOL 8ad5540b942919c7ce0c3b560feb1dc6a0771b81999f546d62b8c480ecb3731994a930c72dde9c5e36d9024d4c1b97b8bd00d8baa98ee99f273c59e43070ae38
+AUX apcupsd-snmp-5.7.2.patch 3967 SHA256 e0eae470fd6f2d5cfc5f9faa3028ba5c13b24dc9c69c4c3a8555e61558378c70 SHA512 080fd6f6bd1aa571458c09b7587dee3fe5937175a6e111976537445e805b1a2a6bbddc28224bdc23cee58a2bedcc2c458ff24f1946fd9cbfbf50500b18124680 WHIRLPOOL b50d1b1deeb51f42230e56d4dfd1927af4858c5f42621acab94c46dc8b46ee9d281f296050f9f5b3e8ba434352eae43a90fd7a3c29d46915a40b257a3570702c
AUX apcupsd-tmpfiles.conf 39 SHA256 b00cd1a31de70a172698d486583aa79113b99c1bb4b882ab906d0e37504d7f55 SHA512 1030992a19558e79a9dddef88b508f9d9aa352223b1031f80751b2ee04821d53a185fe89cd20a7e6677709ac29179accd220a5489488b808b1280dcb2682b578 WHIRLPOOL e34d8064df32f7666e4860b49430b2434b0afb5ee7260d200329373e80a4e81416cee5616aec7ebae7005faac59060d9050fb419f4c75c2bf13024a72b445b32
AUX apcupsd-udev.rules 328 SHA256 0865097a99b321301ec5b0bb51d0560a01df0a21cca0ee0df61f8d33f888b86a SHA512 ba2ebb9f28011548c845a81f17a328b98ec8d79c1e6be33aeab863d77b9d3aa61b4dfbd1bb89a0cae00465387dffe8cc223634a6e9a2f59170846d4bed9e7135 WHIRLPOOL ec304d772bcbcd5ba3cec1437a097d6159ad1f8b8e2bde49125d6cb1970bbc6f1de6264ba35a719431aed83f88210a583bb20fab0b771c115aaa93bf1db8c867
AUX apcupsd.conf 12481 SHA256 2caf66f43439a48d57c4ca0efe3bb1a1f14d8ce0f395bb7f90c65b74313cada9 SHA512 19f9838de025022170ac965aab1532c17aa3eb89a88f83c330ffa33ca34c2fa0eaae007dc3d55c308717af7920e7665df9571bf43ee028d557eebf5a6d393837 WHIRLPOOL 4d1df5b9f8d47d93539240f9f8231b9fbd862014faaea3ae5cd726e61744d9786e5c42bc518df1342b24d8e129c4abc68e731baedc740ccc58e6852560399c93
@@ -15,14 +16,19 @@ DIST apcupsd-3.14.8.tar.gz 1317601 SHA256 8e7f2574d3abaf6637da3e790860c3f9ba64fa
EBUILD apcupsd-3.14.10-r1.ebuild 4060 SHA256 8bd603ca14f6e42a573559d8588354240f74a4eff4b4cab7d62f460320e06fd8 SHA512 6b37efe12be278bce4b6bf7a17c88641bfe13c8304c383112a3309fca33609ca9d02ede3b6c23ed325064878da6e4c8f441ad39e92e68d791fd6348c228f0ca3 WHIRLPOOL 470e178eff2d7e1dcdc19e1860396dd9ca494f10d6e15ab60a9635b763b0f60192a883bec5a5c60ccc00fc3f48aa0035117804384d03d17b8e1cc23be949d579
EBUILD apcupsd-3.14.10-r2.ebuild 4177 SHA256 3ee47fde9a2f7be55208b2f2bbe88fe1cdf57c21783486195e7a904d476bf680 SHA512 af68e532b23719323a88e61e222eb48b5502d022d6d1ea21d56352edbe5cfeeb844b483d77c451940b6eb01c713bcc206b4365369bda7082794cdc327b2e3d0e WHIRLPOOL 54c92f7dffea8841af85867173c36cd361732a0e4ef90f3020c5e2ed7a8078eb2e1157441c2510b234cb7fdb04ee4b36b29dfb296d9227ebe8aa1bc968015599
EBUILD apcupsd-3.14.10-r4.ebuild 4114 SHA256 5ecdb6f31dafdfed58c9b4a13d55fca0190c63e28a9441bffc013862cefc7bf7 SHA512 18d6c6e5661e1ad4f6054c7af36080d0112215d3cb38fc2d0b02aebbe30c88751798637b4d880d3214da7c70b00849d021a69ba6dd6b77bcc69e8396288bcf1c WHIRLPOOL 91f972a1f3fa5c62c705b48eb241a3fd4bfa5a9d4a5127abd4ccaf034ac351da59b2b05c06151c864eb9d9f9f6294639f13405fcaf7c9714e980a9e5ed571e4f
+EBUILD apcupsd-3.14.10-r5.ebuild 4189 SHA256 1346d8205d38a760a1b0db0745b33284f132f2f0dff2b82093c7c4c1ee09f157 SHA512 492ae965a737fd6356cee2783230fd8310f01a40bbd9d71e28332a2c3afba10123362d438a9bdc8422ff7289fb0a2872718fa92f2d7875c7f813198dcd4f71f1 WHIRLPOOL 66d66e012978737d52c723ff1a1f63713fbbe738a37d4f8268c502c53a9f46800bc77a1a7ecb01e2fa1d16d4b882ca90c971f798b53c2c86024058e0740f4f4b
EBUILD apcupsd-3.14.8-r1.ebuild 3863 SHA256 f5d984daecd4a0af67bdd5c44abeea7a4f47ed6ee94623e64e89116ff77e83b5 SHA512 5abc26eb6a258f39d7b4a617e87ee00a51c23aaeff76edd9fbc5a7b898552c5e1a270acd941d7e4d5818184d807e986da0593c239f6945c8d652867966197220 WHIRLPOOL 6ef00f538fdd0da2ac2639ece9e3209ba87190032c650cb003e7358e9f8e66f5255f58bacd0a59a7a16f17f2c393af4fb23eba14af403289444fc18d5b0140d4
EBUILD apcupsd-3.14.8-r2.ebuild 3971 SHA256 a7af0acd9407a8cf3cc2fd63ed2cd5da9383851a4f10468172b7a36ab5c4e1a4 SHA512 3b9d84a81201082b2bb414eb636b4dffda717644bfbaf55b8a44c2e56443819396669b11d04688c0728a225b7c8fc4bac5295d885d1aa41cc5e6fbb52188019b WHIRLPOOL 0c3d429d30c668cec53617b208b1c18327e24788d0fb9ba936ba925ac2a496170c9ab0bae3570fdc8eed0c859585942f417d3c8e3064bc23e0da521c4cee4249
-MISC ChangeLog 27694 SHA256 02b853ebbb55742be788fc5e13a120a6d8b67279c209a35f1ac379d9748a0571 SHA512 21ae0388e923459a78c6c117ecd0742befff5fe39c1a5c51374b360227fa011df2b155b684678dfce9005989289e377fcb77a49fa6c007ac9759fd87ac57bb30 WHIRLPOOL d56b23b20b66d450d6517bd5cd2e3dad8b0388cfd6cd198d9c17ec8b391ef23cbccd03ce9f699dd25a09439b13e505e4c636745449b3e8bdc50e927d7355fb4a
+MISC ChangeLog 27910 SHA256 9e6fec74f18afae908d24cd213347535475d0cdc1a075517e6b0e826b182bdf0 SHA512 db9513c45278a2852a88ffb9ee9c8861c6adf4c4acd3b94a027a9f88598745b450311461107c10db537b472234a22460f8a721389611681f2b7fe94699dd9986 WHIRLPOOL f66cffbb43b4d0ef0607113ee4d0208eeb48018817570471e4c91c85d23085faf1ad50cd2da8d856233cc07b56b665f7ab1eb7fa150fb4e2d7f208e5a85144cb
MISC metadata.xml 854 SHA256 ed821e0f70dad05d8ec1475d40654bb39a4d4ce0e9afb3901282dd05a3662cc5 SHA512 b3d9dbbb217711502dc36e1aca3c6efb18eb31a1f375241ed12a5e1312e19fd74e3659bb9bab3afd9eeff41de7f643a367a406bab09a1bce9d7f41b5e28da988 WHIRLPOOL 7ed63a7e8f4560fccc24d664e6d43c0a9b726b7c41cb1504753869633611968d3d4d29403b07dd0c17e40c8e368b01450d36cf44215906843ff70d505bd0fb7c
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.22 (GNU/Linux)
+Version: GnuPG v2.0.19 (GNU/Linux)
-iF4EAREIAAYFAlJlmLEACgkQC77qH+pIQ6T8lgD/YyfrnphGHEm3Mk2DcPMoHQLQ
-S7OjO1zSFqno8oJZns4A/i1bzgr2ItrvsDfrL0722buRXWrmd2+6mKisrO1kqRfn
-=WF7t
+iQEcBAEBCAAGBQJSZaRVAAoJEC1LWXx4YDenHJ4IAIAFf6gvDjW2nOj+TEcgrQWK
+6yP8vdG7W3t2hH679z4S/kpj9We7pWLjZtGEMwupHZLWjvBz/FMcY8nVe2LXFhz9
+wy9QDT/1leqPMEsxg4Gdghl3+P2ZQ2dvYCaPGJ+umFJkfS/fF7Fabfnhw5cE8IBu
+zCk70udCm8mO2MUqanPFmOoKfmG3HuGgRahBuwWXPEe+bsSb/Fn3yiNadsboMqe0
+gd+g2sOVZU2O7fH4FqeEn/QHf3tqTKPCgo2JbzvPT5+SE+TTRvpsmM105He3HClm
+pW3xu70OcysRx8nVXV1C/mm4aG1Xn+Npcgnh55LPFbISUisb4U13d91pM43sUlA=
+=dCNR
-----END PGP SIGNATURE-----
diff --git a/sys-power/apcupsd/apcupsd-3.14.10-r5.ebuild b/sys-power/apcupsd/apcupsd-3.14.10-r5.ebuild
new file mode 100644
index 000000000000..de81cb59e94f
--- /dev/null
+++ b/sys-power/apcupsd/apcupsd-3.14.10-r5.ebuild
@@ -0,0 +1,143 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/apcupsd-3.14.10-r5.ebuild,v 1.1 2013/10/21 22:01:49 mattm Exp $
+
+EAPI=4
+
+inherit eutils linux-info flag-o-matic systemd udev
+
+DESCRIPTION="APC UPS daemon with integrated tcp/ip remote shutdown"
+HOMEPAGE="http://www.apcupsd.org/"
+SRC_URI="mirror://sourceforge/apcupsd/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="snmp +usb cgi nls gnome kernel_linux systemd"
+
+DEPEND="
+ || ( >=sys-apps/util-linux-2.23[tty-helpers(-)]
+ <=sys-apps/sysvinit-2.88-r4
+ )
+ cgi? ( >=media-libs/gd-1.8.4 )
+ nls? ( sys-devel/gettext )
+ snmp? ( >=net-analyzer/net-snmp-5.7.2 )
+ gnome? ( >=x11-libs/gtk+-2.4.0:2
+ dev-libs/glib:2
+ >=gnome-base/gconf-2.0 )"
+RDEPEND="${DEPEND}
+ sys-apps/openrc
+ virtual/mailx"
+
+CONFIG_CHECK="~USB_HIDDEV ~HIDRAW"
+ERROR_USB_HIDDEV="CONFIG_USB_HIDDEV: needed to access USB-attached UPSes"
+ERROR_HIDRAW="CONFIG_HIDRAW: needed to access USB-attached UPSes"
+
+pkg_setup() {
+ if use kernel_linux && use usb && linux_config_exists; then
+ check_extra_config
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-3.14.9-aliasing.patch"
+ if use snmp; then
+ epatch "${FILESDIR}/${PN}-snmp-5.7.2.patch"
+ fi
+}
+
+src_configure() {
+ local myconf
+ use cgi && myconf="${myconf} --enable-cgi --with-cgi-bin=/usr/libexec/${PN}/cgi-bin"
+ if use usb; then
+ myconf="${myconf} --with-upstype=usb --with-upscable=usb --enable-usb --with-dev= "
+ else
+ myconf="${myconf} --with-upstype=apcsmart --with-upscable=smart --disable-usb"
+ fi
+
+ # We force the DISTNAME to gentoo so it will use gentoo's layout also
+ # when installed on non-linux systems.
+ econf \
+ --sbindir=/sbin \
+ --sysconfdir=/etc/apcupsd \
+ --with-pwrfail-dir=/etc/apcupsd \
+ --with-lock-dir=/var/run/apcupsd \
+ --with-pid-dir=/var/run/apcupsd \
+ --with-log-dir=/var/log \
+ --with-nis-port=3551 \
+ --enable-net --enable-pcnet \
+ --with-distname=gentoo \
+ $(use_enable snmp net-snmp) \
+ $(use_enable gnome gapcmon) \
+ ${myconf} \
+ APCUPSD_MAIL=/bin/mail
+}
+
+src_compile() {
+ # Workaround for bug #280674; upstream should really just provide
+ # the text files in the distribution, but I wouldn't count on them
+ # doing that anytime soon.
+ MANPAGER=$(type -p cat) \
+ emake || die "emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "installed failed"
+ rm -f "${D}"/etc/init.d/halt
+
+ insinto /etc/apcupsd
+ newins examples/safe.apccontrol safe.apccontrol
+ doins "${FILESDIR}"/apcupsd.conf
+
+ dodoc ChangeLog* ReleaseNotes
+ doman doc/*.8 doc/*.5
+
+ dohtml -r doc/manual/*
+
+ rm "${D}"/etc/init.d/apcupsd
+ newinitd "${FILESDIR}/${PN}.init.4" "${PN}"
+ newinitd "${FILESDIR}/${PN}.powerfail.init" "${PN}".powerfail
+
+ if use systemd; then
+ systemd_dounit "${FILESDIR}"/${PN}.service
+ systemd_dotmpfilesd "${FILESDIR}"/${PN}-tmpfiles.conf
+ fi
+
+ # remove hal settings, we don't really want to have it around still.
+ rm -r "${D}"/usr/share/hal
+
+ # replace it with our udev rules if we're in Linux
+ if use kernel_linux; then
+ udev_newrules "${FILESDIR}"/apcupsd-udev.rules 60-${PN}.rules
+ fi
+
+}
+
+pkg_postinst() {
+ if use cgi; then
+ elog "The cgi-bin directory for ${PN} is /usr/libexec/${PN}/cgi-bin."
+ elog "Set up your ScriptAlias or symbolic links accordingly."
+ fi
+
+ elog ""
+ elog "Since version 3.14.0 you can use multiple apcupsd instances to"
+ elog "control more than one UPS in a single box with openRC."
+ elog "To do this, create a link between /etc/init.d/apcupsd to a new"
+ elog "/etc/init.d/apcupsd.something, and it will then load the"
+ elog "configuration file at /etc/apcupsd/something.conf."
+ elog ""
+
+ elog 'If you want apcupsd to power off your UPS when it'
+ elog 'shuts down your system in a power failure, you must'
+ elog 'add apcupsd.powerfail to your shutdown runlevel:'
+ elog ''
+ elog ' \e[01m rc-update add apcupsd.powerfail shutdown \e[0m'
+ elog ''
+
+ if use kernel_linux; then
+ elog "Starting from version 3.14.9-r1, ${PN} installs udev rules"
+ elog "for persistent device naming. If you have multiple UPS"
+ elog "connected to the machine, you can point them to the devices"
+ elog "in /dev/apcups/by-id directory."
+ fi
+}
diff --git a/sys-power/apcupsd/files/apcupsd-snmp-5.7.2.patch b/sys-power/apcupsd/files/apcupsd-snmp-5.7.2.patch
new file mode 100644
index 000000000000..aaa618bbab90
--- /dev/null
+++ b/sys-power/apcupsd/files/apcupsd-snmp-5.7.2.patch
@@ -0,0 +1,104 @@
+--- src/drivers/snmp/snmp.c~ 2007-10-06 15:52:52.000000000 +0100
++++ src/drivers/snmp/snmp.c 2012-08-09 11:22:30.100725543 +0100
+@@ -140,26 +140,26 @@
+
+ if (!strcmp(Sid->DeviceVendor, "APC") ||
+ !strcmp(Sid->DeviceVendor, "APC_NOTRAP")) {
+- Sid->MIB = malloc(sizeof(powernet_mib_t));
+- if (Sid->MIB == NULL) {
++ Sid->mib = malloc(sizeof(powernet_mib_t));
++ if (Sid->mib == NULL) {
+ log_event(ups, LOG_ERR, "Out of memory.");
+ exit(1);
+ }
+
+- memset(Sid->MIB, 0, sizeof(powernet_mib_t));
++ memset(Sid->mib, 0, sizeof(powernet_mib_t));
+
+ /* Run powernet specific init */
+ return powernet_snmp_ups_open(ups);
+ }
+
+ if (!strcmp(Sid->DeviceVendor, "RFC")) {
+- Sid->MIB = malloc(sizeof(ups_mib_t));
+- if (Sid->MIB == NULL) {
++ Sid->mib = malloc(sizeof(ups_mib_t));
++ if (Sid->mib == NULL) {
+ log_event(ups, LOG_ERR, "Out of memory.");
+ exit(1);
+ }
+
+- memset(Sid->MIB, 0, sizeof(ups_mib_t));
++ memset(Sid->mib, 0, sizeof(ups_mib_t));
+ return 1;
+ }
+
+--- src/drivers/snmp/drv_rfc1628.c~ 2012-08-09 11:18:56.001810234 +0100
++++ src/drivers/snmp/drv_rfc1628.c 2012-08-09 11:19:08.845988048 +0100
+@@ -32,7 +32,7 @@
+ struct snmp_ups_internal_data *Sid =
+ (struct snmp_ups_internal_data *)ups->driver_internal_data;
+ struct snmp_session *s = &Sid->session;
+- ups_mib_t *data = (ups_mib_t *)Sid->MIB;
++ ups_mib_t *data = (ups_mib_t *)Sid->mib;
+
+ /*
+ * Check the Ethernet COMMLOST first, then check the
+@@ -76,7 +76,7 @@
+ struct snmp_ups_internal_data *Sid =
+ (struct snmp_ups_internal_data *)ups->driver_internal_data;
+ struct snmp_session *s = &Sid->session;
+- ups_mib_t *data = (ups_mib_t *)Sid->MIB;
++ ups_mib_t *data = (ups_mib_t *)Sid->mib;
+
+ if (rfc_1628_check_alarms(ups) == 0) {
+ return 0;
+@@ -98,7 +98,7 @@
+ struct snmp_ups_internal_data *Sid =
+ (struct snmp_ups_internal_data *)ups->driver_internal_data;
+ struct snmp_session *s = &Sid->session;
+- ups_mib_t *data = (ups_mib_t *)Sid->MIB;
++ ups_mib_t *data = (ups_mib_t *)Sid->mib;
+
+ if (rfc_1628_check_alarms(ups) == 0) {
+ return 0;
+--- src/drivers/snmp/snmp.h~ 2007-10-06 15:52:52.000000000 +0100
++++ src/drivers/snmp/snmp.h 2012-08-09 11:17:43.988802514 +0100
+@@ -79,7 +79,7 @@
+ unsigned short remote_port; /* Remote socket, usually 161 */
+ char *DeviceVendor; /* Vendor (ex. APC|RFC) */
+ char *community; /* Community name */
+- void *MIB; /* Pointer to MIB data */
++ void *mib; /* Pointer to MIB data */
+ struct snmp_session *trap_session; /* snmp session for traps */
+ bool trap_received; /* Have we seen a trap? */
+ };
+--- src/drivers/snmp/drv_powernet.c~ 2010-01-02 21:28:28.000000000 +0000
++++ src/drivers/snmp/drv_powernet.c 2012-08-09 11:20:04.970761477 +0100
+@@ -34,7 +34,7 @@
+ struct snmp_ups_internal_data *Sid =
+ (struct snmp_ups_internal_data *)ups->driver_internal_data;
+ struct snmp_session *s = &Sid->session;
+- powernet_mib_t *data = (powernet_mib_t *)Sid->MIB;
++ powernet_mib_t *data = (powernet_mib_t *)Sid->mib;
+ int ret = 1;
+
+ /*
+@@ -161,7 +161,7 @@
+ struct snmp_ups_internal_data *Sid =
+ (struct snmp_ups_internal_data *)ups->driver_internal_data;
+ struct snmp_session *s = &Sid->session;
+- powernet_mib_t *data = (powernet_mib_t *)Sid->MIB;
++ powernet_mib_t *data = (powernet_mib_t *)Sid->mib;
+
+ if (powernet_check_comm_lost(ups) == 0)
+ return 0;
+@@ -300,7 +300,7 @@
+ struct snmp_ups_internal_data *Sid =
+ (struct snmp_ups_internal_data *)ups->driver_internal_data;
+ struct snmp_session *s = &Sid->session;
+- powernet_mib_t *data = (powernet_mib_t *)Sid->MIB;
++ powernet_mib_t *data = (powernet_mib_t *)Sid->mib;
+
+ if (powernet_check_comm_lost(ups) == 0)
+ return 0;