In lib/pipe-filter.h above pipe_filter_gi_create is says:

If the subprocess does not start correctly,
exit if exit_on_error is true, otherwise return NULL and set errno.

However looking at the implementation (lib/pipe-filter-gi.c)
of the case that exit_on_error is false,
it seems that what is done and what is documented are not the same.

In this error handling part it does not set the retunred filter to NULL:

'''
struct pipe_filter_gi *
pipe_filter_gi_create(...) {

...

  if (filter->child == -1)
    {
      /* Child process could not be created.
Arrange for filter_retcode (filter) to be the current errno. */
      filter->writer_errno = errno;
      filter->writer_terminated = true;
      filter->exited = true;
    }
  else if (filter_init (filter) < 0)
    filter_terminate (filter);

  return filter;
}
'''

Miro Palmu


Reply via email to