delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/03/21/06:27:40

From: ulrich AT lab1 DOT psy DOT univie DOT ac DOT at
Subject: Ctrl-Break and system()/spawn()
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Date: Mon, 21 Mar 1994 12:05:57 +0100 (MET)

Ctrl-Break test program:

	main()
	{
		...
		_go32_dpmi_want_ctrl_break(1);
		...
		if (use_system)
			system("command.com")
		else
			spawnlp(P_WAIT, "command.com", "command.com", NULL);
		...
		/* GO32 terminates with "Ctrl-Break hit ..." at the next DOS call when
		   Ctrl-Break was pressed in command.com. */
	}

I fixed the problem by adding the following line in go32 1.11m4 exphdlr.c:

	uninit_controllers();
	...
	spawn() or dpmisim()

	init_controllers();
	/* patch begin */
	ctrl_break_hit = 0;
	/* patch end */
	break;

uninit_controllers() restores the ctrl_break_func() (int 0x1b), so
ctrl_break_func() (see control.c) is called when Ctrl-Break is pressed in
an external program (assuming the external program does not install its own 0x1b handler).

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019