Skip to content

wrong doc on core::run::run_program #4983

Closed
@Kimundi

Description

@Kimundi

The docs state it returns an process id, but it's actually the exit code.

/**
 * Spawns a process and waits for it to terminate
 *
 * # Arguments
 *
 * * prog - The path to an executable
 * * args - Vector of arguments to pass to the child process
 *
 * # Return value
 *
 * The process id
 */
pub fn run_program(prog: &str, args: &[~str]) -> int {
    let pid = spawn_process(prog, args, &None, &None,
                            0i32, 0i32, 0i32);
    if pid == -1 as pid_t { fail!(); }
    return waitpid(pid);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions