Hello All,

Patch for the bug 2800731 (hpiinv stops if saHpiIdrAreaHeaderGet errors)
is attached for review. This patch basically makes sure hpiinv continues
to go through the next RPT entry even if an area of an RDR returns an
error. Please review this patch. I will wait till Aug 21 to receive
feedback.

Thanks
Mohan



diff -rup openhpi-2.14.0_old/clients/hpiinv.c openhpi-2.14.0_new/clients/hpiinv.c
--- openhpi-2.14.0_old/clients/hpiinv.c	2009-04-16 13:11:27.000000000 -0600
+++ openhpi-2.14.0_new/clients/hpiinv.c	2009-08-12 10:09:51.000000000 -0600
@@ -455,7 +455,7 @@ int
 main(int argc, char **argv)
 {
   int c;
-  SaErrorT rv;
+  SaErrorT rv,rv_rdr;
   SaHpiSessionIdT sessionid;
   SaHpiDomainInfoT rptinfo;
   SaHpiRptEntryT rptentry;
@@ -541,11 +541,12 @@ main(int argc, char **argv)
       if (rptentry.ResourceCapabilities & SAHPI_CAPABILITY_INVENTORY_DATA)
       {
         printf("Resource[%d] Tag: %s \thas inventory capability\n", rptentryid,rptentry.ResourceTag.Data);
-	while ((rv == SA_OK) && (entryid != SAHPI_LAST_ENTRY))
+	rv_rdr = SA_OK;
+	while ((rv_rdr == SA_OK) && (entryid != SAHPI_LAST_ENTRY))
 	{
-          rv = saHpiRdrGet(sessionid,resourceid, entryid,&nextentryid, &rdr);
+          rv_rdr = saHpiRdrGet(sessionid,resourceid, entryid,&nextentryid, &rdr);
   	  if (fdebug) printf("saHpiRdrGet[%x] rv = %d\n",entryid,rv);
-	  if (rv == SA_OK)
+	  if (rv_rdr == SA_OK)
 	  {
   	    if (fdebug) printf("Rdr[%x] type = %d tag = %s\n",entryid,
 				rdr.RdrType,rdr.IdString.Data);
@@ -564,17 +565,17 @@ main(int argc, char **argv)
 	      {
 		/* Get all of the inventory data areas and fields */
 		memset(inv,0,buffersize);
-		rv = saHpiIdrInfoGet(sessionid, resourceid, idrid, &idrInfo);
-		if (rv != SA_OK) {
-		   printf("IDR Info error: rv = %d\n",rv);
+		rv_rdr = saHpiIdrInfoGet(sessionid, resourceid, idrid, &idrInfo);
+		if (rv_rdr != SA_OK) {
+		   printf("IDR Info error: rv_rdr = %d\n",rv_rdr);
 		} else {  /* idrInfo is ok */
 		   if (fdebug) printf("IDR Info: ok \n");
 		   print_epath(&rptentry.ResourceEntity, 1);
 	           printf("RDR[%x]: Inventory, IdrId=%x %s\n",rdr.RecordId,
 			idrid,rdr.IdString.Data);
 		   print_idrinfo(&idrInfo,4);
-		   rv = walkInventory(sessionid, resourceid, &idrInfo);
-		   if (fdebug) printf("walkInventory rv = %d\n",rv);
+		   rv_rdr = walkInventory(sessionid, resourceid, &idrInfo);
+		   if (fdebug) printf("walkInventory rv_rdr = %d\n",rv_rdr);
 		}
 		
 		if (!ent_writable(&rptentry.ResourceEntity,&idrInfo))
@@ -592,13 +593,13 @@ main(int argc, char **argv)
 			strncpy((char *)strptr->Data, atag.tag, atag.tlen);
 			strptr->Data[atag.tlen] = 0;
 			printf( "Writing new asset tag: %s\n",strptr->Data);
-		        rv = saHpiIdrFieldSet(sessionid, resourceid, 
+		        rv_rdr = saHpiIdrFieldSet(sessionid, resourceid, 
 						atag.idrid, &atagField);
-			printf("Return Write Status = %d\n", rv);
-			if (rv == SA_OK) {
+			printf("Return Write Status = %d\n", rv_rdr);
+			if (rv_rdr == SA_OK) {
 			   printf ("Good write - re-reading!\n");
-			   rv = walkInventory(sessionid, resourceid, &idrInfo);
-			   if (fdebug) printf("walkInventory rv = %d\n",rv);
+			   rv_rdr = walkInventory(sessionid, resourceid, &idrInfo);
+			   if (fdebug) printf("walkInventory rv_rdr = %d\n",rv_rdr);
 			} /* Good write - re-read */
 		   }  /*endif fasset*/
   		}  /*endif RDR tag ok*/
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Openhpi-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openhpi-devel

Reply via email to