556
event_operator_fds (EventOperator *root,
564
nih_local char *evlist = NULL;
566
nih_assert (root != NULL);
567
nih_assert (fds != NULL);
568
nih_assert (num_fds != NULL);
569
nih_assert (env != NULL);
570
nih_assert (len != NULL);
571
nih_assert (key != NULL);
573
/* Initialise the event list variable with the name given. */
574
evlist = nih_sprintf (NULL, "%s=", key);
579
NIH_TREE_FOREACH_FULL (&root->node, iter,
580
(NihTreeFilter)event_operator_filter, NULL) {
581
EventOperator *oper = (EventOperator *)iter;
583
if (oper->type != EVENT_MATCH)
586
nih_assert (oper->event != NULL);
588
if (oper->event->fd >= 0) {
589
*fds = nih_realloc (*fds, parent, sizeof (int) * (*num_fds + 1));
593
(*fds)[(*num_fds)++] = oper->event->fd;
595
if (evlist[strlen (evlist) - 1] != '=') {
596
if (! nih_strcat_sprintf (&evlist, NULL, " %d",
600
if (! nih_strcat_sprintf (&evlist, NULL, "%d",
608
if (! environ_add (env, parent, len, TRUE, evlist))
556
615
* event_operator_events:
557
616
* @root: operator tree to collect from,