From 61b0f8e78a11434671fa74da83fe26a6159bb15a Mon Sep 17 00:00:00 2001 From: pancake Date: Thu, 25 Oct 2012 21:56:42 +0200 Subject: [PATCH] Fix build --- binr/rarun2/rarun2.c | 2 +- libr/io/p/io_gdb.c | 2 +- libr/io/p/io_haret.c | 2 +- libr/io/p/io_rap.c | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/binr/rarun2/rarun2.c b/binr/rarun2/rarun2.c index 18a10a13a4..b8cc4af27d 100644 --- a/binr/rarun2/rarun2.c +++ b/binr/rarun2/rarun2.c @@ -103,7 +103,7 @@ static int runfile () { if (p) { RSocket *fd = r_socket_new (0); *p=0; - if (!r_socket_connect_tcp (fd, _connect, p+1)) { + if (!r_socket_connect_tcp (fd, _connect, p+1, 30)) { eprintf ("Cannot connect\n"); return 1; } diff --git a/libr/io/p/io_gdb.c b/libr/io/p/io_gdb.c index 0b9a027d36..1dd5814137 100644 --- a/libr/io/p/io_gdb.c +++ b/libr/io/p/io_gdb.c @@ -45,7 +45,7 @@ static RIODesc *__open(RIO *io, const char *file, int rw, int mode) { return NULL; } _fd = r_socket_new (R_FALSE); - if (_fd && r_socket_connect_tcp (_fd, host, port)) { + if (_fd && r_socket_connect_tcp (_fd, host, port, 30)) { riog = R_NEW (RIOGdb); riog->fd = _fd; riog->desc = gdbwrap_init (_fd->fd, NUM_REGS, 4); diff --git a/libr/io/p/io_haret.c b/libr/io/p/io_haret.c index 024cf7481c..178d3c9ced 100644 --- a/libr/io/p/io_haret.c +++ b/libr/io/p/io_haret.c @@ -91,7 +91,7 @@ static RIODesc *haret__open(struct r_io_t *io, const char *pathname, int rw, int eprintf ("Cannot create new socket\n"); return NULL; } - if (!r_socket_connect_tcp (s, ptr, port)) { + if (!r_socket_connect_tcp (s, ptr, port, 30)) { eprintf ("Cannot connect to '%s' (%s)\n", ptr, port); return NULL; } else eprintf ("Connected to: %s at port %s\n", ptr, port); diff --git a/libr/io/p/io_rap.c b/libr/io/p/io_rap.c index b19c5e4e92..6e0503f432 100644 --- a/libr/io/p/io_rap.c +++ b/libr/io/p/io_rap.c @@ -176,7 +176,7 @@ static RIODesc *rap__open(struct r_io_t *io, const char *pathname, int rw, int m eprintf ("Cannot create new socket\n"); return NULL; } - if (r_socket_connect_tcp (rap_fd, ptr, port) == R_FALSE) { + if (r_socket_connect_tcp (rap_fd, ptr, port, 30) == R_FALSE) { eprintf ("Cannot connect to '%s' (%d)\n", ptr, p); r_socket_free (rap_fd); return NULL; @@ -208,14 +208,14 @@ static RIODesc *rap__open(struct r_io_t *io, const char *pathname, int rw, int m r_socket_read (rap_fd, (ut8 *)&buf, 4); r_mem_copyendian ((ut8 *)&i, (ut8*)buf, 4, ENDIAN); while (i>0) { - n = r_socket_read (rap_fd, (ut8 *)&buf, i); + int n = r_socket_read (rap_fd, (ut8 *)&buf, i); if (n<1) break; buf[i] = 0; io->core_cmd_cb (io->user, buf); n = r_socket_read (rap_fd, (ut8 *)&buf, 4); if (n<1) break; r_mem_copyendian ((ut8 *)&i, (ut8*)buf, 4, ENDIAN); - i -= data; + i -= n; } } else { r_socket_free (rap_fd);