Handle "/dev/stdin" by dup()ing fd 0 so that it works on Win32, too.

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

	* glib-genmarshal.c (main): Handle "/dev/stdin" by dup()ing fd 0
	so that it works on Win32, too.


svn path=/trunk/; revision=5185
This commit is contained in:
Tor Lillqvist 2007-01-01 22:31:18 +00:00 committed by Tor Lillqvist
parent 470152f268
commit 5ff1e1d80b
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2007-01-02 Tor Lillqvist <tml@novell.com>
* glib-genmarshal.c (main): Handle "/dev/stdin" by dup()ing fd 0
so that it works on Win32, too.
2006-12-29 Matthias Clasen <mclasen@redhat.com>
* gtypemodule.h: Define G_DEFINE_DYNAMIC_TYPE and

View File

@ -654,7 +654,12 @@ 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)
fd = dup (0);
else
fd = open (file, O_RDONLY);
if (fd < 0)
{