Opened 5 years ago

Last modified 4 years ago

#13322 new Bugs

boost::process reports ERROR_INVALID_HANDLE instead of ERROR_FILE_NOT_FOUND when program cannot be found

Reported by: jpo38 <jean.porcherot@…> Owned by:
Milestone: To Be Determined Component: process
Version: Boost 1.65.0 Severity: Problem
Keywords: Cc:

Description

Under Windows, the following program outputs "Error is 6" (6 means ERROR_INVALID_HANDLE), while it should report "Error is 2" (2 means ERROR_FILE_NOT_FOUND).

#include <boost/process.hpp>
#include <iostream>

int main( int argc, char* argv[] )
{
    
    try
    {
        boost::process::child p( "foo" );
        p.terminate();
    }
    catch ( boost::process::process_error err )
    {
        std::cout << "Error is " << err.code().value();
    }
    
    return 0;
}

Change History (2)

comment:1 by jpo38 <jean.porcherot@…>, 5 years ago

Version: Boost 1.63.0Boost 1.65.0

comment:2 by John Maddock, 4 years ago

Component: Noneprocess
Note: See TracTickets for help on using tickets.