This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ob] fix mingw compilation


On Tue, Jan 30, 2007 at 10:23:33PM +0200, Eli Zaretskii wrote:
> > From: Vladimir Prus <vladimir@codesourcery.com>
> > Date: Tue, 30 Jan 2007 13:37:14 +0300
> > 
> > @@ -765,18 +768,20 @@ pipe_windows_close (struct serial *scb)
> >  static int
> >  pipe_windows_read (struct serial *scb, size_t count)
> >  {
> > -  HANDLE pipeline_out = (HANDLE) _get_osfhandle (scb->fd);
> > +  HANDLE pipeline_out;
> 
> This one-line change is unnecessary; please put back the original
> code, it's perfectly valid C, and shouldn't trigger any warnings or
> errors from GCC.
> 
> The other changes are okay.
> 
> Thanks.

It's valid either way, of course.  In the interests of all getting
along, I checked this in (to get the message out of my todo queue :-).

-- 
Daniel Jacobowitz
CodeSourcery

2007-02-08  Daniel Jacobowitz  <dan@codesourcery.com>

	* ser-mingw.c (pipe_windows_close): Move variable initialization back
	up.

Index: ser-mingw.c
===================================================================
RCS file: /cvs/src/src/gdb/ser-mingw.c,v
retrieving revision 1.6
diff -u -p -r1.6 ser-mingw.c
--- ser-mingw.c	30 Jan 2007 09:12:43 -0000	1.6
+++ ser-mingw.c	8 Feb 2007 16:21:01 -0000
@@ -768,11 +768,10 @@ pipe_windows_close (struct serial *scb)
 static int
 pipe_windows_read (struct serial *scb, size_t count)
 {
-  HANDLE pipeline_out;
+  HANDLE pipeline_out = (HANDLE) _get_osfhandle (scb->fd);
   DWORD available;
   DWORD bytes_read;
 
-  pipeline_out = (HANDLE) _get_osfhandle (scb->fd);
   if (pipeline_out == INVALID_HANDLE_VALUE)
     return -1;
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]