Index: clients/hpipower.c
===================================================================
--- clients/hpipower.c	(revision 7524)
+++ clients/hpipower.c	(working copy)
@@ -97,6 +97,9 @@
         SaHpiPowerStateT    PowerState;
         char                PowerStateString[3][7]={"off\0","on\0","cycled\0"};
         GOptionContext      *context;
+        SaHpiInt32T         PowerState_on[16];	
+        SaHpiInt32T         Index_on = 0; 	
+        SaHpiInt32T         Flag = 0;
 
         /* Print version strings */
 	oh_prog_version(argv[0]);
@@ -240,6 +243,7 @@
                                        ComputerPtr->NameStr);
                         }
 
+                        PowerState_on[Index + 1]= PowerState;                      
                         /* Print out all of the systems */
                         printf("%2d) %20s  - %s \n\r", (Index + 1),
                                ComputerPtr->NameStr,
@@ -252,6 +256,7 @@
                         if (scanf("%d",&Index) == 0) {
 				printf("Incorrect number\n");
 			}
+                        Index_on=Index;
                         Index--; //normalize to 0..n-1
                         printf("\n");
                 }
@@ -296,21 +301,34 @@
                         printf("Error: Selected system %d was not found.\n", SelectedSystem);
                         return -1;
                 }
+                if (Action == PowerState_on[Index_on])
+                {
+                        Flag = 1;
+                        printf("\n%s -- %20s is already powered %s\n",
+                                       argv[0],
+                                       ComputerPtr->NameStr,
+                                       PowerStateString[Action]);
 
+                }
                 if (Action <= SAHPI_POWER_CYCLE)
                 {
-                        HPI_POWER_DEBUG_PRINT("Setting a New Power State");
-                        // Set the new power status for this computer
-                        Status = saHpiResourcePowerStateSet(SessionId,
+                        if (Flag == 0)
+                        {                      
+                                HPI_POWER_DEBUG_PRINT("Setting a New Power State");
+                                // Set the new power status for this computer
+                                Status = saHpiResourcePowerStateSet(SessionId,
                                                             ComputerPtr->ResID,
                                                             Action);
-                        /* return status */
-                        if (Status == SA_OK)
-                        {
-                                printf("\n%s -- %20s has been successfully powered %s\n",
-                                       argv[0],
-                                       ComputerPtr->NameStr,
-                                       PowerStateString[Action]);
+                                /* return status */
+                                if (Status == SA_OK)
+                                {
+                                        printf("\n%s -- %20s has been   \
+                                                     successfully       \
+                                                     powered %s\n",
+                                                     argv[0],
+                                                     ComputerPtr->NameStr,
+                                                     PowerStateString[Action]);
+                                }
                         }
                 }
                 else   // Report Power status for the system
