* dtable.cc (set_std_handle): Call SetStdHandle with NULL if fd is closed.
(dtable::release): "Close" standard handle if appropriate. * dcrt0.cc (dll_crt0_0): Fix minor switch formatting problem. * fork.cc (frok::parent): Make minor comment indentation change.
This commit is contained in:
		| @@ -1,3 +1,11 @@ | |||||||
|  | 2012-03-20  Christopher Faylor  <me.cygwin2012@cgf.cx> | ||||||
|  |  | ||||||
|  | 	* dtable.cc (set_std_handle): Call SetStdHandle with NULL if fd is | ||||||
|  | 	closed. | ||||||
|  | 	(dtable::release): "Close" standard handle if appropriate. | ||||||
|  | 	* dcrt0.cc (dll_crt0_0): Fix minor switch formatting problem. | ||||||
|  | 	* fork.cc (frok::parent): Make minor comment indentation change. | ||||||
|  |  | ||||||
| 2012-03-20  Corinna Vinschen  <corinna@vinschen.de> | 2012-03-20  Corinna Vinschen  <corinna@vinschen.de> | ||||||
|  |  | ||||||
| 	* syscalls.cc (lseek): Fix debug output. | 	* syscalls.cc (lseek): Fix debug output. | ||||||
|   | |||||||
| @@ -65,10 +65,11 @@ dtable_init () | |||||||
| void __stdcall | void __stdcall | ||||||
| set_std_handle (int fd) | set_std_handle (int fd) | ||||||
| { | { | ||||||
|  |   fhandler_base *fh = cygheap->fdtab[fd]; | ||||||
|   if (fd == 0) |   if (fd == 0) | ||||||
|     SetStdHandle (std_consts[fd], cygheap->fdtab[fd]->get_handle ()); |     SetStdHandle (std_consts[fd], fh ? fh->get_handle () : NULL); | ||||||
|   else if (fd <= 2) |   else if (fd <= 2) | ||||||
|     SetStdHandle (std_consts[fd], cygheap->fdtab[fd]->get_output_handle ()); |     SetStdHandle (std_consts[fd], fh ? fh->get_output_handle () : NULL); | ||||||
| } | } | ||||||
|  |  | ||||||
| int | int | ||||||
| @@ -244,6 +245,8 @@ dtable::release (int fd) | |||||||
|     dec_need_fixup_before (); |     dec_need_fixup_before (); | ||||||
|   fds[fd]->refcnt (-1); |   fds[fd]->refcnt (-1); | ||||||
|   fds[fd] = NULL; |   fds[fd] = NULL; | ||||||
|  |   if (fd <= 2) | ||||||
|  |     set_std_handle (fd); | ||||||
| } | } | ||||||
|  |  | ||||||
| extern "C" int | extern "C" int | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user