Calling RegisterServiceProcess from setsid ?

Pierre A. Humblet
Sat Jun 7 16:32:00 GMT 2003

At 11:12 AM 6/7/2003 -0400, Christopher Faylor wrote:
>I guess fhandler_tty_slave::close could call FreeConsole too when the
>last tty is closed and setsid has been previously called.
>I'll check in a change to do this.

Thanks Chris. That does it.

I met two problems while using try_to_debug in daemons that have 
forked but not yet closed their std handles. 
The most serious was that although gdb was created with a new console, 
it's not always using it for I/O.
In some situations (e.g. try_to_debug is setsid, with sshd) it's 
competing for input with the shell, and losing. 
I don't know how to fix that. 

The other problem is trivial, I had a space in the program path.
Actually it would be better to quote the two %s below.

RCS file: /cvs/src/src/winsup/cygwin/,v
retrieving revision 1.147
diff -u -p -r1.147
---       30 May 2003 15:01:33 -0000      1.147
+++       7 Jun 2003 16:16:41 -0000
@@ -154,7 +154,7 @@ error_start_init (const char *buf)
   for (char *p = strchr (pgm, '\\'); p; p = strchr (p, '\\'))
     *p = '/';
-  __small_sprintf (debugger_command, "%s %s", buf, pgm);
+  __small_sprintf (debugger_command, "%s \"%s\"", buf, pgm);
 static void


More information about the Cygwin-developers mailing list