Lines Matching refs:cur
77 struct pid *cur, *p; in auto_popen() local
90 cur = malloc(sizeof(struct pid)); in auto_popen()
91 if (cur == NULL) in auto_popen()
110 cur->command = checked_strdup(command); in auto_popen()
134 cur->outfp = fdopen(outfds[0], "r"); in auto_popen()
139 cur->pid = pid; in auto_popen()
140 SLIST_INSERT_HEAD(&pidlist, cur, next); in auto_popen()
142 return (cur->outfp); in auto_popen()
148 struct pid *cur, *last = NULL; in auto_pclose() local
155 SLIST_FOREACH(cur, &pidlist, next) { in auto_pclose()
156 if (cur->outfp == iop) in auto_pclose()
158 last = cur; in auto_pclose()
160 if (cur == NULL) { in auto_pclose()
168 fclose(cur->outfp); in auto_pclose()
171 pid = wait4(cur->pid, &status, 0, NULL); in auto_pclose()
176 cur->command, pid, WTERMSIG(status)); in auto_pclose()
182 cur->command, pid, WEXITSTATUS(status)); in auto_pclose()
186 log_debugx("\"%s\", pid %d, terminated gracefully", cur->command, pid); in auto_pclose()
188 free(cur->command); in auto_pclose()
189 free(cur); in auto_pclose()