Lines Matching refs:sp

58 	struct sactab *sp;	/* working pointer to move through PM info */
83 for (sp = Sactab; sp; sp = sp->sc_next)
84 sp->sc_valid = 0;
90 while (sp = read_entry(fp))
91 insert(sp, startflag);
107 register struct sactab *sp; /* working pointer */
126 sp = (struct sactab *) calloc(1, sizeof(struct sactab));
127 if (sp == NULL)
129 sp->sc_sstate = sp->sc_lstate = sp->sc_pstate = NOTRUNNING;
130 (void) memset(sp->sc_utid, '\0', IDLEN);
131 parse(p, sp);
132 return(sp);
139 * args: sp - entry to be inserted
145 insert(sp, startflag)
146 register struct sactab *sp;
162 ret = strcmp(sp->sc_tag, tsp->sc_tag);
164 (void) sprintf(Scratch, "sp->sc_tag <%s> tsp->sc_tag <%s>, ret is %d", sp->sc_tag, tsp->sc_tag, ret);
187 tsp->sc_rsmax = sp->sc_rsmax;
188 tsp->sc_flags = sp->sc_flags;
190 (void) sprintf(Scratch, "replacing <%s>", sp->sc_tag);
197 free(sp->sc_cmd);
198 free(sp);
204 sp->sc_next = Sactab;
205 Sactab = sp;
208 sp->sc_next = savtsp->sc_next;
209 savtsp->sc_next = sp;
212 (void) sprintf(Scratch, "adding <%s>", sp->sc_tag);
217 sp->sc_valid = 1;
218 if (startflag && !(sp->sc_flags & X_FLAG))
219 (void) startpm(sp);
228 sp->sc_next = NULL;
230 Sactab = sp;
232 savtsp->sc_next = sp;
234 (void) sprintf(Scratch, "adding <%s>", sp->sc_tag);
239 sp->sc_valid = 1;
240 if (startflag && !(sp->sc_flags & X_FLAG))
241 (void) startpm(sp);
254 register struct sactab *sp; /* working pointer */
264 sp = savesp = Sactab;
265 while (sp) {
266 if (sp->sc_valid) {
267 savesp = sp;
268 sp = sp->sc_next;
273 switch (sp->sc_sstate) {
283 if (sendsig(sp, SIGTERM))
284 (void) sprintf(Scratch, "could not send SIGTERM to <%s>", sp->sc_tag);
286 (void) sprintf(Scratch, "terminating <%s>", sp->sc_tag);
292 (void) close(sp->sc_fd);
296 cleanutx(sp);
297 tsp = sp;
299 Sactab = sp->sc_next;
303 savesp->sc_next = sp->sc_next;
305 (void) sprintf(Scratch, "purging <%s>", sp->sc_tag);
308 sp = sp->sc_next;
332 register struct sactab *sp; /* working pointer */
358 for (sp = Sactab; sp; sp = sp->sc_next) {
359 size = strlen(sp->sc_tag) + strlen(sp->sc_type) + strlen(sp->sc_cmd) + strlen(sp->sc_comment) + SLOP;
364 (void) sprintf(p, "%s:%s:%d:%d:%d:%s:%s\n", sp->sc_tag, sp->sc_type,
365 sp->sc_flags, sp->sc_rsmax, sp->sc_pstate, sp->sc_cmd, sp->sc_comment);