# # patch "netxx_pipe.cc" # from [9dd364af4ecf5f4a53cdb86d28a4e93f92723dbc] # to [bb3c1957bf6d706a88524947f0dde3f789522c00] # =============================================== --- netxx_pipe.cc 9dd364af4ecf5f4a53cdb86d28a4e93f92723dbc +++ netxx_pipe.cc bb3c1957bf6d706a88524947f0dde3f789522c00 @@ -125,13 +125,19 @@ static void simple_pipe_test() { std::vector args; + std::string cmd; #ifdef WIN32 args.push_back("\\"); - Netxx::PipeStream pipe("dir",args); + cmd="dir"; #else + args.push_back("-l"); args.push_back("/"); - Netxx::PipeStream pipe("ls",args); + cmd="ls"; #endif + Netxx::PipeStream pipe(cmd,args); +#ifndef WIN32 + fcntl(pipe.get_readfd(),F_SETFL,fcntl(pipe.get_readfd(),F_GETFL)&~O_NONBLOCK); +#endif std::string result; char buf[1024]; Netxx::signed_size_type bytes; @@ -142,7 +148,7 @@ } while (true); pipe.close(); BOOST_CHECK(!result.empty()); - L(F("command output is: %s\n") % result); + L(F("command output (%d bytes) is: %s\n") % result.size() % result); } void