Changeset 26521
- Timestamp:
- Jan 5, 2010, 5:01:17 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/pcontrol/MachineOps.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pcontrol/MachineOps.c
r26412 r26521 15 15 16 16 ALLOCATE (machines, Machine *, NMACHINES); 17 memset (machines, NMACHINES*sizeof(Machine *), 0);17 memset (machines, 0, NMACHINES*sizeof(Machine *)); 18 18 19 19 return; … … 36 36 37 37 int i; 38 38 39 39 for (i = 0; i < Nmachines; i++) { 40 40 if (!strcmp (machines[i][0].name, name)) { … … 65 65 NMACHINES += 10; 66 66 REALLOCATE (machines, Machine *, NMACHINES); 67 memset (&machines[Nmachines], (NMACHINES - Nmachines)*sizeof(Machine *), 0);67 memset (&machines[Nmachines], 0, (NMACHINES - Nmachines)*sizeof(Machine *)); 68 68 } 69 69 … … 113 113 ASSERT (machine, "cannot find machine associated with host"); 114 114 machine[0].NjobsRealhost ++; 115 115 116 116 // skip jobs that do not have a targeted host 117 117 if (job[0].hostname == NULL) { … … 128 128 if (machine == NULL) return (TRUE); 129 129 machine[0].NjobsWanthost ++; 130 130 131 131 return (TRUE); 132 132 } … … 155 155 if (machine == NULL) return (TRUE); 156 156 machine[0].NjobsWanthost --; 157 157 158 158 return (TRUE); 159 159 } … … 164 164 Machine *machine; 165 165 166 gprint (GP_LOG, "Nmachines: %d\n", Nmachines); 166 gprint (GP_LOG, "Nmachines: %d\n", Nmachines); 167 167 for (i = 0; i < Nmachines; i++) { 168 168 machine = machines[i]; 169 gprint (GP_LOG, "%s : %d : %d : %d\n", machine[0].name, machine[0].Nhosts, machine[0].NjobsRealhost, machine[0].NjobsWanthost); 169 gprint (GP_LOG, "%s : %d : %d : %d\n", machine[0].name, machine[0].Nhosts, machine[0].NjobsRealhost, machine[0].NjobsWanthost); 170 170 } 171 171
Note:
See TracChangeset
for help on using the changeset viewer.
