Handle "/dev/stdin" by dup()ing fd 0 so that it works on Win32 and other

2007-02-13  Tor Lillqvist  <tml@novell.com>

	* glib-genmarshal.c (main): Handle "/dev/stdin" by dup()ing fd 0
	so that it works on Win32 and other systems without
	/dev/stdin. (#407431)


svn path=/branches/glib-2-12/; revision=5336
This commit is contained in:
Tor Lillqvist
2007-02-13 20:20:10 +00:00
committed by Tor Lillqvist
parent 2802d2cfad
commit 7d11ed4cba
2 changed files with 13 additions and 1 deletions

View File

@@ -1,3 +1,9 @@
2007-02-13 Tor Lillqvist <tml@novell.com>
* glib-genmarshal.c (main): Handle "/dev/stdin" by dup()ing fd 0
so that it works on Win32 and other systems without
/dev/stdin. (#407431)
2007-01-16 Matthias Clasen <mclasen@redhat.com>
* === Released 2.12.9 ===

View File

@@ -652,7 +652,13 @@ main (int argc,
for (slist = files; slist; slist = slist->next)
{
gchar *file = slist->data;
gint fd = open (file, O_RDONLY);
gint fd;
if (strcmp (file, "/dev/stdin") == 0)
/* Mostly for Win32. This is equivalent to opening /dev/stdin */
fd = dup (0);
else
fd = open (file, O_RDONLY);
if (fd < 0)
{