Lines Matching refs:sp

56 	struct sactab *sp;	/* working pointer to move through PM info */  local
81 for (sp = Sactab; sp; sp = sp->sc_next)
82 sp->sc_valid = 0;
88 while (sp = read_entry(fp))
89 insert(sp, startflag);
105 register struct sactab *sp; /* working pointer */ local
124 sp = (struct sactab *) calloc(1, sizeof(struct sactab));
125 if (sp == NULL)
127 sp->sc_sstate = sp->sc_lstate = sp->sc_pstate = NOTRUNNING;
128 (void) memset(sp->sc_utid, '\0', IDLEN);
129 parse(p, sp);
130 return(sp);
143 insert(sp, startflag) in insert() argument
144 register struct sactab *sp; in insert()
160 ret = strcmp(sp->sc_tag, tsp->sc_tag);
162 …(void) sprintf(Scratch, "sp->sc_tag <%s> tsp->sc_tag <%s>, ret is %d", sp->sc_tag, tsp->sc_tag, re…
185 tsp->sc_rsmax = sp->sc_rsmax;
186 tsp->sc_flags = sp->sc_flags;
188 (void) sprintf(Scratch, "replacing <%s>", sp->sc_tag);
195 free(sp->sc_cmd);
196 free(sp);
202 sp->sc_next = Sactab;
203 Sactab = sp;
206 sp->sc_next = savtsp->sc_next;
207 savtsp->sc_next = sp;
210 (void) sprintf(Scratch, "adding <%s>", sp->sc_tag);
215 sp->sc_valid = 1;
216 if (startflag && !(sp->sc_flags & X_FLAG))
217 (void) startpm(sp);
226 sp->sc_next = NULL;
228 Sactab = sp;
230 savtsp->sc_next = sp;
232 (void) sprintf(Scratch, "adding <%s>", sp->sc_tag);
237 sp->sc_valid = 1;
238 if (startflag && !(sp->sc_flags & X_FLAG))
239 (void) startpm(sp);
252 register struct sactab *sp; /* working pointer */ in purge() local
262 sp = savesp = Sactab; in purge()
263 while (sp) { in purge()
264 if (sp->sc_valid) { in purge()
265 savesp = sp; in purge()
266 sp = sp->sc_next; in purge()
271 switch (sp->sc_sstate) { in purge()
281 if (sendsig(sp, SIGTERM)) in purge()
282 (void) sprintf(Scratch, "could not send SIGTERM to <%s>", sp->sc_tag); in purge()
284 (void) sprintf(Scratch, "terminating <%s>", sp->sc_tag); in purge()
290 (void) close(sp->sc_fd); in purge()
294 cleanutx(sp); in purge()
295 tsp = sp; in purge()
297 Sactab = sp->sc_next; in purge()
301 savesp->sc_next = sp->sc_next; in purge()
303 (void) sprintf(Scratch, "purging <%s>", sp->sc_tag); in purge()
306 sp = sp->sc_next; in purge()
330 register struct sactab *sp; /* working pointer */ in dump_table() local
356 for (sp = Sactab; sp; sp = sp->sc_next) { in dump_table()
357 …size = strlen(sp->sc_tag) + strlen(sp->sc_type) + strlen(sp->sc_cmd) + strlen(sp->sc_comment) + SL… in dump_table()
362 (void) sprintf(p, "%s:%s:%d:%d:%d:%s:%s\n", sp->sc_tag, sp->sc_type, in dump_table()
363 sp->sc_flags, sp->sc_rsmax, sp->sc_pstate, sp->sc_cmd, sp->sc_comment); in dump_table()