projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix checks for VSX and Altivec availability on Power
[deliverable/binutils-gdb.git]
/
gdb
/
ser-base.c
diff --git
a/gdb/ser-base.c
b/gdb/ser-base.c
index 06efbc1c1af0931221e709b17af15f6d361c1405..c51be07e0fcfdb74412a746e80ba0c6e45627182 100644
(file)
--- a/
gdb/ser-base.c
+++ b/
gdb/ser-base.c
@@
-1,6
+1,6
@@
/* Generic serial interface functions.
/* Generic serial interface functions.
- Copyright (C) 1992-201
4
Free Software Foundation, Inc.
+ Copyright (C) 1992-201
6
Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
@@
-23,7
+23,7
@@
#include "event-loop.h"
#include "gdb_select.h"
#include "event-loop.h"
#include "gdb_select.h"
-#include
<sys/time.h>
+#include
"gdb_sys_time.h"
#ifdef USE_WIN32API
#include <winsock2.h>
#endif
#ifdef USE_WIN32API
#include <winsock2.h>
#endif
@@
-153,7
+153,7
@@
run_async_handler_and_reschedule (struct serial *scb)
static void
fd_event (int error, void *context)
{
static void
fd_event (int error, void *context)
{
- struct serial *scb = context;
+ struct serial *scb =
(struct serial *)
context;
if (error != 0)
{
scb->bufcnt = SERIAL_ERROR;
if (error != 0)
{
scb->bufcnt = SERIAL_ERROR;
@@
-164,7
+164,13
@@
fd_event (int error, void *context)
pull characters out of the buffer. See also
generic_readchar(). */
int nr;
pull characters out of the buffer. See also
generic_readchar(). */
int nr;
- nr = scb->ops->read_prim (scb, BUFSIZ);
+
+ do
+ {
+ nr = scb->ops->read_prim (scb, BUFSIZ);
+ }
+ while (nr < 0 && errno == EINTR);
+
if (nr == 0)
{
scb->bufcnt = SERIAL_EOF;
if (nr == 0)
{
scb->bufcnt = SERIAL_EOF;
@@
-190,7
+196,7
@@
fd_event (int error, void *context)
static void
push_event (void *context)
{
static void
push_event (void *context)
{
- struct serial *scb = context;
+ struct serial *scb =
(struct serial *)
context;
scb->async_state = NOTHING_SCHEDULED; /* Timers are one-off */
run_async_handler_and_reschedule (scb);
scb->async_state = NOTHING_SCHEDULED; /* Timers are one-off */
run_async_handler_and_reschedule (scb);
@@
-207,6
+213,7
@@
ser_base_wait_for (struct serial *scb, int timeout)
int numfds;
struct timeval tv;
fd_set readfds, exceptfds;
int numfds;
struct timeval tv;
fd_set readfds, exceptfds;
+ int nfds;
/* NOTE: Some OS's can scramble the READFDS when the select()
call fails (ex the kernel with Red Hat 5.2). Initialize all
/* NOTE: Some OS's can scramble the READFDS when the select()
call fails (ex the kernel with Red Hat 5.2). Initialize all
@@
-220,10
+227,13
@@
ser_base_wait_for (struct serial *scb, int timeout)
FD_SET (scb->fd, &readfds);
FD_SET (scb->fd, &exceptfds);
FD_SET (scb->fd, &readfds);
FD_SET (scb->fd, &exceptfds);
+ QUIT;
+
+ nfds = scb->fd + 1;
if (timeout >= 0)
if (timeout >= 0)
- numfds =
gdb_select (scb->fd + 1
, &readfds, 0, &exceptfds, &tv);
+ numfds =
interruptible_select (nfds
, &readfds, 0, &exceptfds, &tv);
else
else
- numfds =
gdb_select (scb->fd + 1
, &readfds, 0, &exceptfds, 0);
+ numfds =
interruptible_select (nfds
, &readfds, 0, &exceptfds, 0);
if (numfds <= 0)
{
if (numfds <= 0)
{
@@
-358,7
+368,11
@@
do_ser_base_readchar (struct serial *scb, int timeout)
if (status < 0)
return status;
if (status < 0)
return status;
- status = scb->ops->read_prim (scb, BUFSIZ);
+ do
+ {
+ status = scb->ops->read_prim (scb, BUFSIZ);
+ }
+ while (status < 0 && errno == EINTR);
if (status <= 0)
{
if (status <= 0)
{
@@
-440,15
+454,21
@@
ser_base_readchar (struct serial *scb, int timeout)
int
ser_base_write (struct serial *scb, const void *buf, size_t count)
{
int
ser_base_write (struct serial *scb, const void *buf, size_t count)
{
- const char *str = buf;
+ const char *str =
(const char *)
buf;
int cc;
while (count > 0)
{
int cc;
while (count > 0)
{
+ QUIT;
+
cc = scb->ops->write_prim (scb, str, count);
if (cc < 0)
cc = scb->ops->write_prim (scb, str, count);
if (cc < 0)
- return 1;
+ {
+ if (errno == EINTR)
+ continue;
+ return 1;
+ }
count -= cc;
str += cc;
}
count -= cc;
str += cc;
}
@@
-541,6
+561,14
@@
ser_base_setstopbits (struct serial *scb, int num)
return 0; /* Never fails! */
}
return 0; /* Never fails! */
}
+/* Implement the "setparity" serial_ops callback. */
+
+int
+ser_base_setparity (struct serial *scb, int parity)
+{
+ return 0; /* Never fails! */
+}
+
/* Put the SERIAL device into/out-of ASYNC mode. */
void
/* Put the SERIAL device into/out-of ASYNC mode. */
void
This page took
0.027068 seconds
and
4
git commands to generate.