diff options
Diffstat (limited to 'sys-power/apcupsd/files/apcupsd-snmp-5.7.2.patch')
-rw-r--r-- | sys-power/apcupsd/files/apcupsd-snmp-5.7.2.patch | 104 |
1 files changed, 104 insertions, 0 deletions
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; |