Re: Using "Filtered View" gives error "Cannot create pipe streams"

Never mind, I have found the reason for the error. The Filtered View command does not currently use the PATH environment variable to find the executable provided.

I have submitted a pull request for this:

Is someone able to have a look for me?

To replicate the problem:
1. In mc, open the "File" menu and select "Filtered View"
2. In the displayed Filtered View command and arguments field, type "grep PATTERN FILENAME"

Expected result: display output of grep command in mcview
Actual result: Error is displayed "Cannot create pipe streams"

Reason: The grep command is not in the current directory, and the PATH environment variable is not used to search for the executable.


On Sun, Apr 12, 2015 at 2:18 AM Ben Woods <woodsb02 gmail com> wrote:

I am maintaining the midnight commander port for FreeBSD, and I am seeing an error with v4.8.14.

When I use the "Filtered View" option from the File menu, and enter any filter (e.g. "*.c"), it gives me an error message "Cannot create pipe streams".

This error appears to be from the function mc_popen in file lib/utilunix.c (excerpt below). Any ideas how I can troubleshoot this further?

Thanks in advance,

 * Create pipe and run child process.
 * @parameter command command line of child process
 * @paremeter error contains pointer to object to handle error code and message
 * @return newly created object of mc_pipe_t class in success, NULL otherwise

mc_pipe_t *
mc_popen (const char *command, GError ** error)
    mc_pipe_t *p;
    char **argv;

    p = g_try_new (mc_pipe_t, 1);
    if (p == NULL)
        mc_replace_error (error, MC_PIPE_ERROR_CREATE_PIPE, "%s",
                          _("Cannot create pipe descriptor"));
        goto ret_err;

    if (!g_shell_parse_argv (command, NULL, &argv, error))
        mc_replace_error (error, MC_PIPE_ERROR_PARSE_COMMAND, "%s",
                          _("Cannot parse command for pipe"));
        goto ret_err;

    if (!g_spawn_async_with_pipes (NULL, argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL,
                                   &p->child_pid, NULL, &p->out.fd, &p->err.fd, error))
        mc_replace_error (error, MC_PIPE_ERROR_CREATE_PIPE_STREAM, "%s",
                          _("Cannot create pipe streams"));
        goto ret_err;

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]