summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-04-17 23:25:14 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-04-17 23:25:14 +0000
commitdcf9a09a033ce0e5420a7ef719e8e88e3eeaeb5c (patch)
tree404d1c4801ba81599555f4e3398f09228b580cd6 /tools
parent5e225e3d197b9a02617153ac570755cc4d13226b (diff)
Handle EINTR errors
Diffstat (limited to 'tools')
-rw-r--r--tools/hciattach.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/hciattach.c b/tools/hciattach.c
index 45ce4d7b..a01c149f 100644
--- a/tools/hciattach.c
+++ b/tools/hciattach.c
@@ -1135,7 +1135,7 @@ static void usage(void)
int main(int argc, char *argv[])
{
struct uart_t *u = NULL;
- int detach, printpid, opt, i, n, ld;
+ int detach, printpid, opt, i, n, ld, err;
int to = 5;
int init_speed = 0;
int send_break = 0;
@@ -1286,7 +1286,10 @@ int main(int argc, char *argv[])
while (!__io_canceled) {
p.revents = 0;
- if (poll(&p, 1, 500))
+ err = poll(&p, 1, 500);
+ if (err < 0 && errno == EINTR)
+ continue;
+ if (err)
break;
}