static void run_status_loggers(struct invoke_hook *hook_head) { struct invoke_hook *hook; for (hook = hook_head; hook; hook = hook->next) { pid_t pid; int p[2]; m_pipe(p); pid = subproc_fork(); if (pid == 0) { /* Setup stdin and stdout. */ m_dup2(p[0], 0); close(1); close(p[0]); close(p[1]); command_shell(hook->command, _("status logger")); } close(p[0]); statusfd_add(p[1]); } }
static void set_pipe(const struct cmdinfo *cip, const char *value) { long v; v = dpkg_options_parse_arg_int(cip, value); statusfd_add(v); }
static void setpipe(const struct cmdinfo *cip, const char *value) { unsigned long v; char *ep; v= strtoul(value,&ep,0); if (value == ep || *ep || v > INT_MAX) badusage(_("invalid integer for --%s: `%.250s'"),cip->olong,value); statusfd_add(v); }
static void run_status_loggers(struct invoke_list *hook_list) { struct invoke_hook *hook; for (hook = hook_list->head; hook; hook = hook->next) { int fd; fd = run_logger(hook, _("status logger")); statusfd_add(fd); } }