rpms/openhpi/devel openhpi-2.4.1-gcc41.patch, NONE, 1.1 openhpi-2.4.1-werror.patch, NONE, 1.1 .cvsignore, 1.6, 1.7 openhpi.spec, 1.30, 1.31 sources, 1.6, 1.7 openhpi-1.9.1-glib.patch, 1.1, NONE openhpi-1.9.1-is_simulator.patch, 1.1, NONE openhpi-1.9.2-net_snmp_config.patch, 1.1, NONE openhpi-1.9.2-overflow.patch, 1.2, NONE openhpi-1.9.2-rebuild.patch, 1.1, NONE openhpi-1.9.2-werror.patch, 1.1, NONE openhpi-2.2.1-gcc4.patch, 1.1, NONE openhpi-2.2.1-nowerror.patch, 1.1, NONE
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Tue May 23 15:48:39 UTC 2006
Author: pknirsch
Update of /cvs/dist/rpms/openhpi/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv32302
Modified Files:
.cvsignore openhpi.spec sources
Added Files:
openhpi-2.4.1-gcc41.patch openhpi-2.4.1-werror.patch
Removed Files:
openhpi-1.9.1-glib.patch openhpi-1.9.1-is_simulator.patch
openhpi-1.9.2-net_snmp_config.patch
openhpi-1.9.2-overflow.patch openhpi-1.9.2-rebuild.patch
openhpi-1.9.2-werror.patch openhpi-2.2.1-gcc4.patch
openhpi-2.2.1-nowerror.patch
Log Message:
- Added missing glib2-devel build prereq (#191935)
- Update to latest stable version openhpi-2.4.1
openhpi-2.4.1-gcc41.patch:
snmp_bc.c | 17 ++++--
snmp_bc_annunciator.c | 70 ++++++++++++++++++--------
snmp_bc_control.c | 22 +++++---
snmp_bc_discover.c | 49 ++++++++++--------
snmp_bc_discover_bc.c | 3 -
snmp_bc_discover_rsa.c | 3 -
snmp_bc_event.c | 28 +++++++---
snmp_bc_hotswap.c | 50 +++++++++++++------
snmp_bc_inventory.c | 32 ++++++------
snmp_bc_power.c | 18 ++++--
snmp_bc_reset.c | 19 ++++---
snmp_bc_sel.c | 41 ++++++++-------
snmp_bc_sensor.c | 123 ++++++++++++++++++++++++++++++-----------------
snmp_bc_session.c | 3 -
snmp_bc_time.c | 3 -
t/sim_file.c | 2
t/snmp_bc.c | 18 ++++--
t/snmp_bc_annunciator.c | 70 ++++++++++++++++++--------
t/snmp_bc_control.c | 22 +++++---
t/snmp_bc_discover.c | 50 ++++++++++---------
t/snmp_bc_discover_bc.c | 3 -
t/snmp_bc_discover_rsa.c | 3 -
t/snmp_bc_event.c | 29 +++++++----
t/snmp_bc_hotswap.c | 50 +++++++++++++------
t/snmp_bc_inventory.c | 30 +++++------
t/snmp_bc_power.c | 18 ++++--
t/snmp_bc_reset.c | 19 ++++---
t/snmp_bc_sel.c | 42 ++++++++--------
t/snmp_bc_sensor.c | 121 ++++++++++++++++++++++++++++++----------------
t/snmp_bc_session.c | 3 -
t/snmp_bc_time.c | 3 -
t/tsetup.c | 13 ++--
32 files changed, 623 insertions(+), 354 deletions(-)
--- NEW FILE openhpi-2.4.1-gcc41.patch ---
--- openhpi-2.4.1/plugins/snmp_bc/snmp_bc_discover_rsa.c.gcc41 2006-05-23 14:55:35.000000000 +0200
+++ openhpi-2.4.1/plugins/snmp_bc/snmp_bc_discover_rsa.c 2006-05-23 14:55:56.000000000 +0200
@@ -24,13 +24,14 @@
struct oh_event *e;
struct snmp_value get_value;
struct ResourceInfo *res_info_ptr;
+ struct snmp_bc_hnd *custom_handle;
if (!handle || !ep_root) {
dbg("Invalid parameter.");
return(SA_ERR_HPI_INVALID_PARAMS);
}
- struct snmp_bc_hnd *custom_handle = (struct snmp_bc_hnd *)handle->data;
+ custom_handle = (struct snmp_bc_hnd *)handle->data;
if (!custom_handle) {
dbg("Invalid parameter.");
return(SA_ERR_HPI_INVALID_PARAMS);
--- openhpi-2.4.1/plugins/snmp_bc/snmp_bc_discover.c.gcc41 2006-05-23 14:06:19.000000000 +0200
+++ openhpi-2.4.1/plugins/snmp_bc/snmp_bc_discover.c 2006-05-23 14:53:46.000000000 +0200
@@ -35,14 +35,25 @@
char *root_tuple;
SaErrorT err = SA_OK, err1 = SA_OK;
SaHpiEntityPathT ep_root;
+ struct oh_handler_state *handle;
+ struct snmp_bc_hnd *custom_handle;
+ SaHpiEntityPathT valEntity;
+ GSList *res_new = NULL, *rdr_new = NULL, *res_gone = NULL;
+ GSList *rdr_gone = NULL, *node = NULL;
+ GSList *tmpnode = NULL;
+ SaHpiRdrT *rdr;
+ SaHpiRptEntryT *res;
+ struct oh_event *e;
+ gpointer data;
+ guint rdr_data_size;
if (!hnd) {
dbg("Invalid parameter.");
return(SA_ERR_HPI_INVALID_PARAMS);
}
- struct oh_handler_state *handle = (struct oh_handler_state *)hnd;
- struct snmp_bc_hnd *custom_handle = (struct snmp_bc_hnd *)handle->data;
+ handle = (struct oh_handler_state *)hnd;
+ custom_handle = (struct snmp_bc_hnd *)handle->data;
if (!custom_handle) {
dbg("Invalid parameter.");
return(SA_ERR_HPI_INVALID_PARAMS);
@@ -92,21 +103,17 @@
* Get difference between current rptcache and custom_handle->tmpcache.
* Delete obsolete items from rptcache and add new items in.
**********************************************************************/
- SaHpiEntityPathT valEntity;
- GSList *res_new = NULL, *rdr_new = NULL, *res_gone = NULL, *rdr_gone = NULL;
- GSList *node = NULL;
-
rpt_diff(handle->rptcache, custom_handle->tmpcache, &res_new, &rdr_new, &res_gone, &rdr_gone);
trace("%d resources have gone away.", g_slist_length(res_gone));
trace("%d resources are new or have changed", g_slist_length(res_new));
for (node = rdr_gone; node != NULL; node = node->next) {
- SaHpiRdrT *rdr = (SaHpiRdrT *)node->data;
+ rdr = (SaHpiRdrT *)node->data;
snmp_bc_validate_ep(&(rdr->Entity), &valEntity);
- SaHpiRptEntryT *res = oh_get_resource_by_ep(handle->rptcache, &(valEntity));
+ res = oh_get_resource_by_ep(handle->rptcache, &(valEntity));
/* Create remove RDR event and add to event queue */
- struct oh_event *e = (struct oh_event *)g_malloc0(sizeof(struct oh_event));
+ e = (struct oh_event *)g_malloc0(sizeof(struct oh_event));
if (e) {
e->did = oh_get_default_domain_id();
e->type = OH_ET_RDR_DEL;
@@ -124,9 +131,9 @@
g_slist_free(rdr_gone);
for (node = res_gone; node != NULL; node = node->next) {
- SaHpiRptEntryT *res = (SaHpiRptEntryT *)node->data;
+ res = (SaHpiRptEntryT *)node->data;
/* Create remove resource event and add to event queue */
- struct oh_event *e = (struct oh_event *)g_malloc0(sizeof(struct oh_event));
+ e = (struct oh_event *)g_malloc0(sizeof(struct oh_event));
if (e) {
e->did = oh_get_default_domain_id();
e->type = OH_ET_RESOURCE_DEL;
@@ -143,13 +150,13 @@
g_slist_free(res_gone);
for (node = res_new; node != NULL; node = node->next) {
- GSList *tmpnode = NULL;
- SaHpiRptEntryT *res = (SaHpiRptEntryT *)node->data;
+ tmpnode = NULL;
+ res = (SaHpiRptEntryT *)node->data;
if (!res) {
dbg("No valid resource at hand. Could not process new resource.");
continue;
}
- gpointer data = oh_get_resource_data(custom_handle->tmpcache, res->ResourceId);
+ data = oh_get_resource_data(custom_handle->tmpcache, res->ResourceId);
if (data) {
oh_add_resource(handle->rptcache, res, g_memdup(data, sizeof(struct snmp_rpt)),0);
/* Add new/changed resources to the event queue */
@@ -171,16 +178,16 @@
g_slist_free(res_new);
for (node = rdr_new; node != NULL; node = node->next) {
- guint rdr_data_size = 0;
- GSList *tmpnode = NULL;
- SaHpiRdrT *rdr = (SaHpiRdrT *)node->data;
+ rdr_data_size = 0;
+ tmpnode = NULL;
+ rdr = (SaHpiRdrT *)node->data;
snmp_bc_validate_ep(&(rdr->Entity), &valEntity);
- SaHpiRptEntryT *res = oh_get_resource_by_ep(handle->rptcache, &(valEntity));
+ res = oh_get_resource_by_ep(handle->rptcache, &(valEntity));
if (!res || !rdr) {
dbg("No valid resource or rdr at hand. Could not process new rdr.");
continue;
}
- gpointer data = oh_get_rdr_data(custom_handle->tmpcache, res->ResourceId, rdr->RecordId);
+ data = oh_get_rdr_data(custom_handle->tmpcache, res->ResourceId, rdr->RecordId);
/* Need to figure out the size of the data associated with the rdr */
if (rdr->RdrType == SAHPI_SENSOR_RDR) rdr_data_size = sizeof(struct SensorInfo);
else if (rdr->RdrType == SAHPI_CTRL_RDR)
@@ -190,7 +197,7 @@
oh_add_rdr(handle->rptcache, res->ResourceId, rdr, g_memdup(data, rdr_data_size),0);
/* Add new/changed rdrs to the event queue */
for (tmpnode = custom_handle->tmpqueue; tmpnode != NULL; tmpnode = tmpnode->next) {
- struct oh_event *e = (struct oh_event *)tmpnode->data;
+ e = (struct oh_event *)tmpnode->data;
if (e->type == OH_ET_RDR &&
oh_cmp_ep(&(e->u.rdr_event.rdr.Entity),&(rdr->Entity)) &&
e->u.rdr_event.rdr.RecordId == rdr->RecordId) {
@@ -606,7 +613,7 @@
int j;
gchar *pch;
- struct snmp_bc_sensor *sensor_array = (struct snmp_bc_sensor *)sensor_array_in;;
+ struct snmp_bc_sensor *sensor_array = (struct snmp_bc_sensor *)sensor_array_in;
struct snmp_bc_ipmi_sensor *sensor_array_ipmi = (struct snmp_bc_ipmi_sensor *)sensor_array_in;
SaHpiEntityPathT ep_add = {
.Entry[0] =
--- openhpi-2.4.1/plugins/snmp_bc/snmp_bc_session.c.gcc41 2006-05-23 16:57:21.000000000 +0200
+++ openhpi-2.4.1/plugins/snmp_bc/snmp_bc_session.c 2006-05-23 17:02:19.000000000 +0200
@@ -284,13 +284,14 @@
**/
void snmp_bc_close(void *hnd)
{
+ struct oh_handler_state *handle;
if (!hnd) {
dbg("INVALID PARM - NULL handle pointer.");
return;
}
- struct oh_handler_state *handle = (struct oh_handler_state *)hnd;
+ handle = (struct oh_handler_state *)hnd;
oh_el_close(handle->elcache);
if (is_simulator()) {
--- openhpi-2.4.1/plugins/snmp_bc/snmp_bc_discover_bc.c.gcc41 2006-05-23 14:54:51.000000000 +0200
+++ openhpi-2.4.1/plugins/snmp_bc/snmp_bc_discover_bc.c 2006-05-23 14:55:10.000000000 +0200
@@ -357,13 +357,14 @@
struct oh_event *e;
struct snmp_value get_value, get_active, get_blade_resourcetag;
struct ResourceInfo *res_info_ptr;
+ struct snmp_bc_hnd *custom_handle;
if (!handle || !ep_root) {
dbg("Invalid parameter.");
return(SA_ERR_HPI_INVALID_PARAMS);
}
- struct snmp_bc_hnd *custom_handle = (struct snmp_bc_hnd *)handle->data;
+ custom_handle = (struct snmp_bc_hnd *)handle->data;
if (!custom_handle) {
dbg("Invalid parameter.");
return(SA_ERR_HPI_INVALID_PARAMS);
--- openhpi-2.4.1/plugins/snmp_bc/snmp_bc_annunciator.c.gcc41 2006-05-23 13:46:37.000000000 +0200
+++ openhpi-2.4.1/plugins/snmp_bc/snmp_bc_annunciator.c 2006-05-23 13:57:43.000000000 +0200
@@ -38,13 +38,17 @@
SaHpiBoolT unackonly,
SaHpiAnnouncementT *announcement)
{
+ struct oh_handler_state *handle;
+ struct snmp_bc_hnd *custom_handle;
+ SaHpiRptEntryT *rpt;
+
if (!hnd || !announcement || oh_lookup_severity(sev) == NULL) {
dbg("Invalid parameter.");
return SA_ERR_HPI_INVALID_PARAMS;
}
- struct oh_handler_state *handle = (struct oh_handler_state *)hnd;
- struct snmp_bc_hnd *custom_handle = (struct snmp_bc_hnd *)handle->data;
+ handle = (struct oh_handler_state *)hnd;
+ custom_handle = (struct snmp_bc_hnd *)handle->data;
if (!custom_handle) {
[...2886 lines suppressed...]
+ custom_handle = (struct snmp_bc_hnd *)handle->data;
i_record = (struct bc_inventory_record *)g_malloc0(sizeof(struct bc_inventory_record));
if (!i_record) {
@@ -378,14 +381,9 @@
struct bc_inventory_record *i_record)
{
SaErrorT rv = SA_OK;
-
-
- if (!hnd || !i_record)
- return(SA_ERR_HPI_INVALID_PARAMS);
-
- struct oh_handler_state *handle = (struct oh_handler_state *) hnd;
- struct snmp_bc_hnd *custom_handle = handle->data;
- SaHpiRdrT *rdr = oh_get_rdr_by_type(handle->rptcache, ResourceId, SAHPI_INVENTORY_RDR, IdrId);
+ struct oh_handler_state *handle;
+ struct snmp_bc_hnd *custom_handle;
+ SaHpiRdrT *rdr;
SaHpiEntityPathT valEntity;
struct snmp_value get_value;
@@ -393,8 +391,13 @@
SaHpiIdrFieldT thisField;
struct bc_idr_area thisInventoryArea;
+ if (!hnd || !i_record)
+ return(SA_ERR_HPI_INVALID_PARAMS);
-
+ handle = (struct oh_handler_state *) hnd;
+ custom_handle = handle->data;
+ rdr = oh_get_rdr_by_type(handle->rptcache, ResourceId, SAHPI_INVENTORY_RDR, IdrId);
+
if (rdr != NULL) {
struct InventoryInfo *s =
@@ -591,13 +594,12 @@
SaHpiIdrFieldT *thisField,
struct bc_idr_area *thisInventoryArea)
{
+ struct snmp_value get_value;
+ SaErrorT rv = SA_OK;
if (!custom_handle || !thisField || !thisInventoryArea)
return(SA_ERR_HPI_INVALID_PARAMS);
- struct snmp_value get_value;
- SaErrorT rv = SA_OK;
-
/**
*
*/
--- openhpi-2.4.1/plugins/snmp_bc/snmp_bc_reset.c.gcc41 2006-05-23 15:35:43.000000000 +0200
+++ openhpi-2.4.1/plugins/snmp_bc/snmp_bc_reset.c 2006-05-23 15:39:47.000000000 +0200
@@ -34,13 +34,17 @@
SaHpiResourceIdT rid,
SaHpiResetActionT *act)
{
+ struct oh_handler_state *handle;
+ struct snmp_bc_hnd *custom_handle;
+ SaHpiRptEntryT *rpt;
+
if (!hnd || !act) {
dbg("Invalid parameter.");
return(SA_ERR_HPI_INVALID_PARAMS);
}
- struct oh_handler_state *handle = (struct oh_handler_state *)hnd;
- struct snmp_bc_hnd *custom_handle = (struct snmp_bc_hnd *)handle->data;
+ handle = (struct oh_handler_state *)hnd;
+ custom_handle = (struct snmp_bc_hnd *)handle->data;
if (!custom_handle) {
dbg("Invalid parameter.");
@@ -49,7 +53,7 @@
snmp_bc_lock_handler(custom_handle);
/* Check if resource exists and has reset capabilities */
- SaHpiRptEntryT *rpt = oh_get_resource_by_id(handle->rptcache, rid);
+ rpt = oh_get_resource_by_id(handle->rptcache, rid);
if (!rpt) {
snmp_bc_unlock_handler(custom_handle);
return(SA_ERR_HPI_INVALID_RESOURCE);
@@ -88,6 +92,9 @@
SaErrorT err;
struct ResourceInfo *resinfo;
struct snmp_value set_value;
+ struct oh_handler_state *handle;
+ struct snmp_bc_hnd *custom_handle;
+ SaHpiRptEntryT *rpt;
if (!hnd || NULL == oh_lookup_resetaction(act)){
dbg("Invalid parameter.");
@@ -95,8 +102,8 @@
}
if (act == SAHPI_RESET_ASSERT || act == SAHPI_RESET_DEASSERT) return(SA_ERR_HPI_INVALID_CMD);
- struct oh_handler_state *handle = (struct oh_handler_state *)hnd;
- struct snmp_bc_hnd *custom_handle = (struct snmp_bc_hnd *)handle->data;
+ handle = (struct oh_handler_state *)hnd;
+ custom_handle = (struct snmp_bc_hnd *)handle->data;
if (!custom_handle) {
dbg("Invalid parameter.");
@@ -105,7 +112,7 @@
snmp_bc_lock_handler(custom_handle);
/* Check if resource exists and has reset capabilities */
- SaHpiRptEntryT *rpt = oh_get_resource_by_id(handle->rptcache, rid);
+ rpt = oh_get_resource_by_id(handle->rptcache, rid);
if (!rpt) {
snmp_bc_unlock_handler(custom_handle);
return(SA_ERR_HPI_INVALID_RESOURCE);
--- openhpi-2.4.1/plugins/snmp_bc/snmp_bc.c.gcc41 2006-05-23 11:50:49.000000000 +0200
+++ openhpi-2.4.1/plugins/snmp_bc/snmp_bc.c 2006-05-23 11:52:52.000000000 +0200
@@ -32,13 +32,14 @@
{
SaErrorT err;
struct oh_handler_state *handle = (struct oh_handler_state *)hnd;
+ struct snmp_bc_hnd *custom_handle;
if (!event || !hnd) {
dbg("Invalid parameter");
return(SA_ERR_HPI_INVALID_PARAMS);
}
- struct snmp_bc_hnd *custom_handle = (struct snmp_bc_hnd *)handle->data;
+ custom_handle = (struct snmp_bc_hnd *)handle->data;
snmp_bc_lock_handler(custom_handle);
err = snmp_bc_check_selcache(handle, 1, SAHPI_NEWEST_ENTRY);
@@ -83,12 +84,13 @@
SaHpiRptEntryT *rpt;
struct oh_event *e;
struct oh_handler_state *handle = (struct oh_handler_state *)hnd;
+ struct snmp_bc_hnd *custom_handle;
if (!oh_valid_textbuffer(tag) || !hnd) {
dbg("Invalid parameter");
return(SA_ERR_HPI_INVALID_PARAMS);
}
- struct snmp_bc_hnd *custom_handle = (struct snmp_bc_hnd *)handle->data;
+ custom_handle = (struct snmp_bc_hnd *)handle->data;
snmp_bc_lock_handler(custom_handle);
rpt = oh_get_resource_by_id(handle->rptcache, rid);
@@ -138,12 +140,13 @@
SaHpiRptEntryT *rpt;
struct oh_handler_state *handle = (struct oh_handler_state *)hnd;
struct oh_event *e;
+ struct snmp_bc_hnd *custom_handle;
if (oh_lookup_severity(sev) == NULL) {
dbg("Invalid parameter");
return(SA_ERR_HPI_INVALID_PARAMS);
}
- struct snmp_bc_hnd *custom_handle = (struct snmp_bc_hnd *)handle->data;
+ custom_handle = (struct snmp_bc_hnd *)handle->data;
snmp_bc_lock_handler(custom_handle);
rpt = oh_get_resource_by_id(handle->rptcache, rid);
@@ -185,6 +188,9 @@
**/
SaErrorT snmp_bc_control_parm(void *hnd, SaHpiResourceIdT rid, SaHpiParmActionT act)
{
+ SaHpiRptEntryT *rpt;
+ struct oh_handler_state *handle;
+ struct snmp_bc_hnd *custom_handle;
if (!hnd) return(SA_ERR_HPI_INVALID_PARAMS);
if (oh_lookup_parmaction(act) == NULL) {
@@ -192,9 +198,8 @@
return(SA_ERR_HPI_INVALID_PARAMS);
}
- SaHpiRptEntryT *rpt;
- struct oh_handler_state *handle = (struct oh_handler_state *)hnd;
- struct snmp_bc_hnd *custom_handle = (struct snmp_bc_hnd *)handle->data;
+ handle = (struct oh_handler_state *)hnd;
+ custom_handle = (struct snmp_bc_hnd *)handle->data;
snmp_bc_lock_handler(custom_handle);
rpt = oh_get_resource_by_id(handle->rptcache, rid);
--- openhpi-2.4.1/plugins/snmp_bc/snmp_bc_time.c.gcc41 2006-05-23 17:02:44.000000000 +0200
+++ openhpi-2.4.1/plugins/snmp_bc/snmp_bc_time.c 2006-05-23 17:03:22.000000000 +0200
@@ -300,11 +300,12 @@
struct snmp_value get_value;
struct tm tmptime;
SaErrorT rv = SA_OK;
+ struct snmp_bc_hnd *custom_handle;
if (!handle || !time)
return(SA_ERR_HPI_INVALID_PARAMS);
- struct snmp_bc_hnd *custom_handle = (struct snmp_bc_hnd *)handle->data;
+ custom_handle = (struct snmp_bc_hnd *)handle->data;
if (custom_handle->platform == SNMP_BC_PLATFORM_RSA) {
rv = snmp_bc_snmp_get(custom_handle, SNMP_BC_DATETIME_OID_RSA, &get_value, SAHPI_TRUE);
openhpi-2.4.1-werror.patch:
clients/hpipower.c | 8 ++++++--
clients/hpisettime.c | 10 +++++++---
clients/hpithres.c | 9 +++++----
hpi_shell/commands.c | 3 ++-
openhpid2/openhpid.cpp | 8 ++++----
plugins/ipmidirect/ipmi_log.cpp | 6 +++---
plugins/simulator/sim_injector.c | 22 +++++++++++-----------
plugins/watchdog/watchdog.c | 12 +++++++++---
utils/el_utils.c | 6 +++++-
utils/uid_utils.c | 22 ++++++++++++++++++----
10 files changed, 70 insertions(+), 36 deletions(-)
--- NEW FILE openhpi-2.4.1-werror.patch ---
--- openhpi-2.4.1/hpi_shell/commands.c.werror 2006-05-23 17:17:20.000000000 +0200
+++ openhpi-2.4.1/hpi_shell/commands.c 2006-05-23 17:20:05.000000000 +0200
@@ -1086,7 +1086,8 @@
strcat(buf, " ");
strcat(buf, term->term);
};
- system(buf);
+ if (system(buf) < 0)
+ return(HPI_SHELL_CMD_ERROR);
return(HPI_SHELL_OK);
}
--- openhpi-2.4.1/clients/hpisettime.c.werror 2004-10-12 15:12:48.000000000 +0200
+++ openhpi-2.4.1/clients/hpisettime.c 2006-05-22 15:39:07.000000000 +0200
@@ -110,7 +110,9 @@
if (findate) {
if (fdebug) printf("New date to be set: %s\n",i_newdate);
- sscanf(i_newdate,"%2d/%2d/%4d", &month, &day, &year);
+ if (sscanf(i_newdate,"%2d/%2d/%4d", &month, &day, &year) < 8) {
+ printf("%s: Invalid date\n", argv[0]);
+ }
/* check month, day and year for correctness */
if ((month < 1) || (month > 12)) {
printf("%s: Month out of range: (%d)\n", argv[0], month);
@@ -141,8 +143,10 @@
if (fintime) {
if (fdebug) printf("New time to be set: %s\n",i_newtime);
- sscanf(i_newtime,"%2d:%2d:%2d",
- &new_tm_time.tm_hour, &new_tm_time.tm_min, &new_tm_time.tm_sec);
+ if (sscanf(i_newtime,"%2d:%2d:%2d",
+ &new_tm_time.tm_hour, &new_tm_time.tm_min, &new_tm_time.tm_sec) < 6) {
+ printf("%s: Invalid time\n", argv[0]);
+ }
/* check hours, minutes and seconds for correctness */
if ((new_tm_time.tm_hour < 0) || (new_tm_time.tm_hour > 24)) {
printf("%s: Hours out of range: (%d)\n", argv[0], new_tm_time.tm_hour);
--- openhpi-2.4.1/clients/hpipower.c.werror 2004-11-30 20:39:46.000000000 +0100
+++ openhpi-2.4.1/clients/hpipower.c 2006-05-22 15:39:07.000000000 +0200
@@ -265,7 +265,9 @@
while ((Index >= ComputerNumber) || (Index < 0))
{
printf("\nEnter the number for the desired blade: ");
- scanf("%d",&Index);
+ if (scanf("%d",&Index) == 0) {
+ printf("Incorrect number\n");
+ }
Index--; //normalize to 0..n-1
printf("\n");
}
@@ -279,7 +281,9 @@
/* prompt user to select an action */
printf("\nSelect Action: 0 - Off; 1 - On; 2 - Reset; 3 - Status \n\r");
printf("Enter a number 0 to 3: ");
- scanf("%d", &Index);
+ if (scanf("%d", &Index) == 0) {
+ Index = -1;
+ }
switch (Index)
{
case 0:
--- openhpi-2.4.1/clients/hpithres.c.werror 2006-05-23 17:24:54.000000000 +0200
+++ openhpi-2.4.1/clients/hpithres.c 2006-05-23 17:30:26.000000000 +0200
@@ -356,9 +356,10 @@
static int get_number(char *mes, int *res)
{
char buf[READ_BUF_SIZE];
+ char *ret;
printf("%s", mes);
- fgets(buf, READ_BUF_SIZE, stdin);
+ ret = fgets(buf, READ_BUF_SIZE, stdin);
return (sscanf(buf, "%d", res));
}
@@ -422,7 +423,7 @@
Rdr->is_value = 1;
};
printf("threshold type (lc, la, li, uc, ua, ui, ph, nh): ");
- fgets(buf, READ_BUF_SIZE, stdin);
+ S = fgets(buf, READ_BUF_SIZE, stdin);
S = buf;
while (*S == ' ') S++;
if (strlen(S) < 2) {
@@ -445,7 +446,7 @@
};
printf("new value: ");
- fgets(buf, READ_BUF_SIZE, stdin);
+ S = fgets(buf, READ_BUF_SIZE, stdin);
i = sscanf(buf, "%f", &f);
if (i == 0) {
printf("ERROR: no value\n");
@@ -482,7 +483,7 @@
printf("\n Nem threshold:\n");
ShowThres(&thres);
printf("Is it correct (yes, no)?:");
- fgets(buf, READ_BUF_SIZE, stdin);
+ S = fgets(buf, READ_BUF_SIZE, stdin);
S = buf;
while (*S == ' ') S++;
if (strncmp(S, "yes", 3) != 0)
--- openhpi-2.4.1/plugins/watchdog/watchdog.c.werror 2005-06-07 23:57:25.000000000 +0200
+++ openhpi-2.4.1/plugins/watchdog/watchdog.c 2006-05-22 15:39:07.000000000 +0200
@@ -150,7 +150,9 @@
wdt = tmp->data;
if (wdt->data.Running) {
- write(wdt->fd, "V", 1);
+ if (write(wdt->fd, "V", 1) != 1) {
+ dbg("write in watchdog failed");
+ }
close(wdt->fd);
}
@@ -242,13 +244,17 @@
/* before it is too late */
if ( -1 == ioctl(wdt->fd, WDIOC_SETTIMEOUT, &timeout)) {
dbg("unable to set watchdog timeout");
- write(wdt->fd, "V", 1);
+ if (write(wdt->fd, "V", 1) != 1) {
+ dbg("write in watchdog failed");
+ }
close(wdt->fd);
return 0;
}
if ( -1 == ioctl(wdt->fd, WDIOC_GETTIMEOUT, &timeout)) {
dbg("unable to read watchdog timeout");
- write(wdt->fd, "V", 1);
+ if (write(wdt->fd, "V", 1) != 1) {
+ dbg("write in watchdog failed");
+ }
close(wdt->fd);
return 0;
}
--- openhpi-2.4.1/plugins/ipmidirect/ipmi_log.cpp.werror 2006-05-23 17:05:54.000000000 +0200
+++ openhpi-2.4.1/plugins/ipmidirect/ipmi_log.cpp 2006-05-23 17:10:50.000000000 +0200
@@ -164,13 +164,13 @@
int l = strlen( str );
if ( m_fd )
- fwrite( str, l, 1, m_fd );
+ l = fwrite( str, l, 1, m_fd );
if ( m_std_out )
- fwrite( str, l, 1, stdout );
+ l = fwrite( str, l, 1, stdout );
if ( m_std_err )
- fwrite( str, l, 1, stderr );
+ l = fwrite( str, l, 1, stderr );
}
--- openhpi-2.4.1/plugins/simulator/sim_injector.c.werror 2006-05-23 17:15:00.000000000 +0200
+++ openhpi-2.4.1/plugins/simulator/sim_injector.c 2006-05-23 17:16:22.000000000 +0200
@@ -368,7 +368,7 @@
struct oh_event ohevent;
char *value;
- memset(&ohevent, sizeof(struct oh_event), 0);
+ value = memset(&ohevent, sizeof(struct oh_event), 0);
ohevent.did = oh_get_default_domain_id();
ohevent.type = OH_ET_HPI;
@@ -626,7 +626,7 @@
struct oh_event ohevent;
char *value;
- memset(&ohevent, sizeof(struct oh_event), 0);
+ value = memset(&ohevent, sizeof(struct oh_event), 0);
ohevent.did = oh_get_default_domain_id();
ohevent.type = OH_ET_HPI;
@@ -783,7 +783,7 @@
struct oh_event ohevent;
char *value;
- memset(&ohevent, sizeof(struct oh_event), 0);
+ value = memset(&ohevent, sizeof(struct oh_event), 0);
ohevent.did = oh_get_default_domain_id();
ohevent.type = OH_ET_HPI;
@@ -872,7 +872,7 @@
struct oh_event ohevent;
char *value;
- memset(&ohevent, sizeof(struct oh_event), 0);
+ value = memset(&ohevent, sizeof(struct oh_event), 0);
ohevent.did = oh_get_default_domain_id();
ohevent.type = OH_ET_HPI;
@@ -984,7 +984,7 @@
struct oh_event ohevent;
char *value;
- memset(&ohevent, sizeof(struct oh_event), 0);
+ value = memset(&ohevent, sizeof(struct oh_event), 0);
ohevent.did = oh_get_default_domain_id();
ohevent.type = OH_ET_HPI;
@@ -1085,7 +1085,7 @@
struct oh_event ohevent;
char *value;
- memset(&ohevent, sizeof(struct oh_event), 0);
+ value = memset(&ohevent, sizeof(struct oh_event), 0);
ohevent.did = oh_get_default_domain_id();
ohevent.type = OH_ET_HPI;
@@ -1177,7 +1177,7 @@
struct oh_event ohevent;
char *value;
- memset(&ohevent, sizeof(struct oh_event), 0);
+ value = memset(&ohevent, sizeof(struct oh_event), 0);
ohevent.did = oh_get_default_domain_id();
ohevent.type = OH_ET_HPI;
@@ -1260,7 +1260,7 @@
struct oh_event ohevent;
char *value;
- memset(&ohevent, sizeof(struct oh_event), 0);
+ value = memset(&ohevent, sizeof(struct oh_event), 0);
ohevent.did = oh_get_default_domain_id();
ohevent.type = OH_ET_HPI;
@@ -1337,7 +1337,7 @@
struct oh_event ohevent;
char *value;
- memset(&ohevent, sizeof(struct oh_event), 0);
+ value = memset(&ohevent, sizeof(struct oh_event), 0);
ohevent.did = oh_get_default_domain_id();
ohevent.type = OH_ET_HPI;
@@ -1404,7 +1404,7 @@
char *comment;
SaErrorT rc;
- memset(&data, sizeof(data), 0);
+ value = memset(&data, sizeof(data), 0);
/* get the handler state */
value = find_value(SIM_MSG_HANDLER_NAME, buf->mtext);
@@ -1532,7 +1532,7 @@
struct SensorInfo *sinfo; // our extra info
SaErrorT rc;
- memset(&data, sizeof(data), 0);
+ value = memset(&data, sizeof(data), 0);
/* get the handler state */
value = find_value(SIM_MSG_HANDLER_NAME, buf->mtext);
--- openhpi-2.4.1/openhpid2/openhpid.cpp.werror 2006-05-23 17:21:07.000000000 +0200
+++ openhpi-2.4.1/openhpid2/openhpid.cpp 2006-05-23 17:23:06.000000000 +0200
@@ -232,7 +232,7 @@
exit(1);
}
snprintf(pid_buf, sizeof(pid_buf), "%d\n", (int)getpid());
- write(pfile, pid_buf, strlen(pid_buf));
+ len = write(pfile, pid_buf, strlen(pid_buf));
close(pfile);
// see if we have a valid configuration file
@@ -321,7 +321,7 @@
static bool morph2daemon(void)
{
char pid_buf[256];
- int pfile;
+ int pfile, ret;
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
return false;
@@ -353,11 +353,11 @@
unlink(pid_file);
pfile = open(pid_file, O_WRONLY | O_CREAT, 0640);
snprintf(pid_buf, sizeof(pid_buf), "%d\n", (int)getpid());
- write(pfile, pid_buf, strlen(pid_buf));
+ ret = write(pfile, pid_buf, strlen(pid_buf));
close(pfile);
// housekeeping
- chdir("/");
+ ret = chdir("/");
umask(0);
for(int i = 0; i < 1024; i++) {
close(i);
--- openhpi-2.4.1/utils/uid_utils.c.werror 2005-09-09 17:15:58.000000000 +0200
+++ openhpi-2.4.1/utils/uid_utils.c 2006-05-22 15:39:07.000000000 +0200
@@ -207,9 +207,17 @@
file = open(uid_map_file, O_WRONLY);
if (file >= 0) {
lseek(file, 0, SEEK_END);
- write(file,ep_xref, sizeof(EP_XREF));
+ if (write(file,ep_xref, sizeof(EP_XREF)) != sizeof(EP_XREF)) {
+ dbg("write ep_xref failed");
+ close(file);
+ return 0;
+ }
lseek(file, 0, SEEK_SET);
- write(file, &resource_id, sizeof(resource_id));
+ if (write(file, &resource_id, sizeof(resource_id)) != sizeof(resource_id)) {
+ dbg("write resource_id failed");
+ close(file);
+ return 0;
+ }
}
close(file);
@@ -364,7 +372,11 @@
}
/* write resource id */
- write(file, (void *)&resource_id, sizeof(resource_id));
+ if (write(file, (void *)&resource_id, sizeof(resource_id)) != sizeof(resource_id)) {
+ dbg("write resource_id failed");
+ close(file);
+ return -1;
+ }
/* write all EP_XREF data records */
g_hash_table_foreach(oh_resource_id_table, write_ep_xref, &file);
@@ -389,7 +401,9 @@
*/
static void write_ep_xref(gpointer key, gpointer value, gpointer file)
{
- write(*(int *)file, value, sizeof(EP_XREF));
+ if (write(*(int *)file, value, sizeof(EP_XREF)) != sizeof(EP_XREF)) {
+ dbg("write EP_XREF failed");
+ }
}
--- openhpi-2.4.1/utils/el_utils.c.werror 2005-09-09 10:20:19.000000000 +0200
+++ openhpi-2.4.1/utils/el_utils.c 2006-05-22 15:39:07.000000000 +0200
@@ -322,7 +322,11 @@
ellist = g_list_first(el->elentries);
while (ellist != NULL) {
- write(file, (void *)ellist->data, sizeof(oh_el_entry));
+ if (write(file, (void *)ellist->data, sizeof(oh_el_entry)) != sizeof(oh_el_entry)) {
+ dbg("Couldn't write to file '%s'.", filename);
+ close(file);
+ return SA_ERR_HPI_ERROR;
+ }
ellist = g_list_next(ellist);
}
Index: .cvsignore
===================================================================
RCS file: /cvs/dist/rpms/openhpi/devel/.cvsignore,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- .cvsignore 11 Nov 2005 14:37:11 -0000 1.6
+++ .cvsignore 23 May 2006 15:48:36 -0000 1.7
@@ -1 +1 @@
-openhpi-2.2.1.tar.gz
+openhpi-2.4.1.tar.gz
Index: openhpi.spec
===================================================================
RCS file: /cvs/dist/rpms/openhpi/devel/openhpi.spec,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- openhpi.spec 11 Feb 2006 04:49:23 -0000 1.30
+++ openhpi.spec 23 May 2006 15:48:36 -0000 1.31
@@ -1,18 +1,15 @@
Summary: openhpi Hardware Platform Interface (HPI) library and tools
Name: openhpi
-Version: 2.2.1
-Release: 4.2
+Version: 2.4.1
+Release: 1
License: BSD
Group: System Environment/Base
Source: http://prdownloads.sourceforge.net/openhpi/%{name}-%{version}.tar.gz
Source1: openhpi.conf
-Patch1: openhpi-1.9.2-rebuild.patch
-Patch2: openhpi-1.9.2-overflow.patch
-Patch3: openhpi-1.9.2-werror.patch
-Patch4: openhpi-2.2.1-gcc4.patch
-Patch5: openhpi-2.2.1-nowerror.patch
+Patch1: openhpi-2.4.1-werror.patch
+Patch2: openhpi-2.4.1-gcc41.patch
BuildRoot: /var/tmp/%{name}-root
-BuildRequires: sysfsutils-devel, net-snmp-devel, OpenIPMI-devel
+BuildRequires: sysfsutils-devel, net-snmp-devel, OpenIPMI-devel, glib2-devel
BuildRequires: elfutils-devel, rpm-devel, libtool-ltdl-devel, bzip2-devel
ExcludeArch: ia64
@@ -41,11 +38,8 @@
%prep
%setup -q
-%patch1 -p1 -b .rebuild
-%patch2 -p1 -b .overflow
-%patch3 -p1 -b .werror
-%patch4 -p1 -b .gcc4
-%patch5 -p1 -b .nowerror
+%patch1 -p1 -b .werror
+%patch2 -p1 -b .gcc41
%build
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
@@ -93,6 +87,10 @@
%changelog
+* Fri May 19 2006 Phil Knirsch <pknirsch at redhat.com> - 2.4.1-1
+- Added missing glib2-devel build prereq (#191935)
+- Update to latest stable version openhpi-2.4.1
+
* Fri Feb 10 2006 Jesse Keating <jkeating at redhat.com> - 2.2.1-4.2
- bump again for double-long bug on ppc(64)
Index: sources
===================================================================
RCS file: /cvs/dist/rpms/openhpi/devel/sources,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- sources 11 Nov 2005 14:37:11 -0000 1.6
+++ sources 23 May 2006 15:48:36 -0000 1.7
@@ -1 +1 @@
-d1c914dcc3fb482cb58299fec377f7b4 openhpi-2.2.1.tar.gz
+a7a3f1a9bb6e8b63f50bf0c04334f948 openhpi-2.4.1.tar.gz
--- openhpi-1.9.1-glib.patch DELETED ---
--- openhpi-1.9.1-is_simulator.patch DELETED ---
--- openhpi-1.9.2-net_snmp_config.patch DELETED ---
--- openhpi-1.9.2-overflow.patch DELETED ---
--- openhpi-1.9.2-rebuild.patch DELETED ---
--- openhpi-1.9.2-werror.patch DELETED ---
--- openhpi-2.2.1-gcc4.patch DELETED ---
--- openhpi-2.2.1-nowerror.patch DELETED ---
More information about the fedora-cvs-commits
mailing list