/* Serial interface for local (hardwired) serial ports on Windows systems
- Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GDB.
return -1;
}
- scb->fd = _open_osfhandle ((long) h, O_RDWR);
+ scb->fd = _open_osfhandle ((intptr_t) h, O_RDWR);
if (scb->fd < 0)
{
errno = ENOENT;
SetEvent(state->have_stopped);
}
+ return 0;
}
static int
SetEvent (state->have_stopped);
}
+ return 0;
}
static DWORD WINAPI
SetEvent (state->have_stopped);
}
+ return 0;
}
static void
if (isatty (scb->fd))
{
struct ser_console_ttystate *state;
+
state = (struct ser_console_ttystate *) xmalloc (sizeof *state);
state->is_a_tty = 1;
return state;
HANDLE h = (HANDLE) _get_osfhandle (fd);
DWORD numBytes;
BOOL r = PeekNamedPipe (h, NULL, 0, NULL, &numBytes, NULL);
+
if (r == FALSE)
numBytes = 0;
return numBytes;