Hi,

The new spawn implementation now hits me worse as it won't (can't?)
save file handle attributes such as O_APPEND.. This makes me think
about Windows console issue that led to the new spawn patch. Could we
just compile git with -mwindows and revert part of the patch? We don't
really use Windows console, only standard file handles.

I tried a simple program to emulate git-gui/fetch case, a GUI (t1)
spawns a console app (t2), then feeds it a string via t2' stdin. It
still works well if I make t2 a GUI app.

Comments?
-- 
Duy
#include <windows.h>
#include <process.h>
#include <fcntl.h>
#include <stdio.h>

int main(int argc, char **argv)
{
	int fds[2];
	MessageBox(NULL, "A", "A", MB_OK);
	_pipe(fds, 0, _O_NOINHERIT);
	close(0);
	close(1);
	_dup2(fds[0], 0);
	close(fds[0]);
	_spawnl(_P_NOWAIT, "t2.exe", "t2", NULL);
	write(fds[1], "123\n", 4);
	close(fds[1]);
	MessageBox(NULL, "B", "B", MB_OK);
	return 0;
}
#include <windows.h>
#include <stdio.h>

int main(int argc, char **argv)
{
	FILE *fp = fopen("out", "w");
	int ch;
	MessageBox(NULL, "t2", "t2", MB_OK);
	while ((ch = fgetc(stdin)) != -1)
		fputc(ch, fp);
	fclose(fp);
	return 0;
}

Reply via email to