# # patch "Makefile.am" # from [b27a780b1fca41262466b957cee8c36ed25b1f34] # to [766ce22e4c6ae31b621644dd68ebb4acbc1a43fb] # # patch "netxx_pipe.cc" # from [b2146d50491f0472822516a4ebbe4e9553bd9933] # to [c3886f69d62f103de4fa4cb83e9e8cc87cc8538d] # =============================================== --- Makefile.am b27a780b1fca41262466b957cee8c36ed25b1f34 +++ Makefile.am 766ce22e4c6ae31b621644dd68ebb4acbc1a43fb @@ -181,7 +181,7 @@ monotone_CPPFLAGS = unit_tests_LDFLAGS = -unit_tests_CPPFLAGS = -DBUILD_UNIT_TESTS +unit_tests_CPPFLAGS = -DBUILD_UNIT_TESTS -I. # conditionals from configury =============================================== --- netxx_pipe.cc b2146d50491f0472822516a4ebbe4e9553bd9933 +++ netxx_pipe.cc c3886f69d62f103de4fa4cb83e9e8cc87cc8538d @@ -56,6 +56,7 @@ #ifdef WIN32 #include #include +#include #endif Netxx::PipeStream::PipeStream (const std::string &cmd, const std::vector &args) @@ -65,9 +66,10 @@ int fd1[2],fd2[2]; fd1[0]=-1; fd1[1]=-1; fd2[0]=-1; fd2[1]=-1; - if (_pipe(fd1,0,false)) throw oops("pipe failed"); - if (_pipe(fd2,0,false)) + if (_pipe(fd1,0,_O_BINARY)) throw oops("pipe failed"); + if (_pipe(fd2,0,_O_BINARY)) // | O_NOINHERIT { ::close(fd1[0]); ::close(fd1[1]); throw oops("pipe failed"); } + // abuse dup, use spawnvp? PROCESS_INFORMATION piProcInfo; STARTUPINFO siStartInfo; memset(&piProcInfo,0,sizeof piProcInfo); @@ -81,9 +83,11 @@ std::string cmdline="\""+cmd+"\" "; for (std::vector::const_iterator i=args.begin();i!=args.end();++i) cmdline+="\""+*i+"\" "; + L(F("cmdline '%s'\n") % cmdline); bool result= CreateProcess(0,const_cast(cmdline.c_str()), - 0,0,false,0,0,0,&siStartInfo,&piProcInfo); - if (!result) throw oops("CreateProcess failed"); + 0,0,TRUE,0,0,0,&siStartInfo,&piProcInfo); + if (!result) + { L(F("err %d\n") % GetLastError()); throw oops("CreateProcess failed"); } ::close(fd1[1]); ::close(fd2[0]); child=long(piProcInfo.hProcess); @@ -160,8 +164,8 @@ { std::vector args; std::string cmd; #ifdef WIN32 - args.push_back("\\"); - cmd="dir"; + args.push_back("--version"); + cmd="monotone"; #else args.push_back("-l"); args.push_back("/");