Changeset 4705 for trunk/Ohana/src/opihi/pantasks/JobOps.c
- Timestamp:
- Aug 3, 2005, 5:50:08 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/pantasks/JobOps.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pantasks/JobOps.c
r4693 r4705 50 50 int i; 51 51 52 fprintf (stderr, "\n"); 52 53 if (Njobs == 0) { 53 fprintf (stderr, " no defined jobs\n");54 fprintf (stderr, " no defined jobs\n"); 54 55 return; 55 56 } 56 57 58 fprintf (stderr, " Jobs\n"); 57 59 for (i = 0; i < Njobs; i++) { 58 fprintf (stderr, " %d: %-15s %5d %20s (%lx)\n", Njobs, jobs[i][0].task[0].name, jobs[i][0].JobID, jobs[i][0].argv[0], (long) jobs[i][0].argv);60 fprintf (stderr, " %d: %-15s %5d %20s (%lx)\n", Njobs, jobs[i][0].task[0].name, jobs[i][0].JobID, jobs[i][0].argv[0], (long) jobs[i][0].argv); 59 61 } 60 62 return; … … 76 78 } 77 79 78 /* we need our own copy of task[0].argv 79 * argc is the number of valid args, like the usual command line. 80 * we allocate one extra element, with value 0 to be passed to execvp 80 /* we need our own copy of task[0].argv argc is the number of valid args, like the usual command line. we 81 * allocate one extra element, with value 0 to be passed to execvp 81 82 */ 82 83 job[0].argc = task[0].argc; … … 87 88 job[0].argv[i] = 0; 88 89 89 /* other data from the task is needed by the job 90 we carry a pointer back to the task. this means we 91 cannot modify the task once a job is created, or the changes will 92 be applied to the existing jobs */ 90 /* Other data from the task is needed by the job. We carry a pointer back to the task. Changes to an 91 executing task are applied to the existing jobs (exit macros, poll_period, timeout) */ 93 92 94 93 job[0].task = task; 95 94 96 /* if we decide we need to be able to dynamically set task qualities 97 (like host, timeouts, etc), the we will need to have matched 98 entries to these quantites in the job structure */ 95 /* if we decide we need to be able to dynamically set task qualities (like host, timeouts, etc), the we will 96 need to have matched entries to these quantites in the job structure */ 99 97 100 98 jobs[Njobs] = job; … … 122 120 } 123 121 124 /* * are we deleting the active job?? **/122 /* delete the job from the job list & adjust ActiveJob counter */ 125 123 int DeleteJob (Job *job) { 126 124 … … 140 138 141 139 FreeJob (jobs[Nm]); 142 for (i = Nm + 1; i < Njobs; i++) 143 jobs[i - 1] = jobs[i]; 140 for (i = Nm; i < Njobs - 1; i++) { 141 jobs[i] = jobs[i + 1]; 142 } 144 143 Njobs --; 145 144
Note:
See TracChangeset
for help on using the changeset viewer.
