Fix gspawn-win32-helper.c with newer Microsoft CRTs
authorChun-wei Fan <fanchunwei@src.gnome.org>
Tue, 26 Feb 2013 04:38:57 +0000 (12:38 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Fri, 1 Mar 2013 08:12:37 +0000 (16:12 +0800)
commitc7996825ce999a99f2d73722419c0d11d0b52238
tree6480bc4533daae2f8bdd197f214ca665231ea90c
parent872d3634a78b417612d90c3472d5cd7078ef2440
Fix gspawn-win32-helper.c with newer Microsoft CRTs

The newer Microsoft CRTs (8.0/2005 and later) impose much stricter
(paranoid) checks on close() being doubly called and the use of
invalid file descriptors.  This makes the calls on the file descriptors
use more caution when using them and only call close() when necessary.

This also adds an (empty) invalid parameter handler* as required by the
newer Microsoft CRTs to prevent the system from aborting the process
when we are checking whether a file descriptor is valid.

[*]: http://msdn.microsoft.com/en-us/library/a9yf33zb.aspx

https://bugzilla.gnome.org/show_bug.cgi?id=693646
glib/gspawn-win32-helper.c