[GRASS5] Exit with parent on Windows

Hi,
currently db drivers on Windows are started by
  pid = _spawnl ( _P_NOWAIT, startup, "", NULL );
everything works but if a module which started the driver
crashes the driver remains running.
Anybody has idea how to force the driver to exit if its parent exited?

Thanks
Radim

I found the problem,
driver process on Windows does inherits the ends of pipes used
by module and consequently that ends are not closed even if close()
is called on them in module. It works if I call close() in driver
unfortunately I dont know the numbers of discriptors to close.

How can I close all file descriptors? _fcloseall() does not work
because streams are not inherited(?). Can I get somehow
maximum number of open descriptor?

Radim

On 5/3/06, Radim Blazek <radim.blazek@gmail.com> wrote:

Hi,
currently db drivers on Windows are started by
  pid = _spawnl ( _P_NOWAIT, startup, "", NULL );
everything works but if a module which started the driver
crashes the driver remains running.
Anybody has idea how to force the driver to exit if its parent exited?

Thanks
Radim