diff options
author | Thomas Osterried <thomas@osterried.de> | 2009-01-24 02:58:24 +0000 |
---|---|---|
committer | Thomas Osterried <thomas@osterried.de> | 2009-01-24 02:58:24 +0000 |
commit | d3d8414eac23144d3f39ee16e3eaa5a39a8c160d (patch) | |
tree | 9c02f02486c1a1de553778b8a28ebf24e8530a6c /call | |
parent | 5a750f37af866c04ac82f15b21af2a53c066e3a7 (diff) |
fixed problem i produced yesterday.
currently we've seen other bugs in call which lead to malfunctions
and segfaults.
Diffstat (limited to 'call')
-rw-r--r-- | call/call.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/call/call.c b/call/call.c index dcded79..7b15547 100644 --- a/call/call.c +++ b/call/call.c @@ -1546,7 +1546,7 @@ int cmd_call(char *call[], int mode) if (uploadfile != -1) FD_SET(fd, &sock_write); - if (select(fd + 1, &sock_read, &sock_write, NULL, (uploadfile == -1 && downloadfile == 0 ? NULL : &tv)) == -1) { + if (select(fd + 1, &sock_read, &sock_write, NULL, (uploadfile == -1 && downloadfile == -1) ? NULL : &tv) == -1) { if (!interrupted && errno == EAGAIN) continue; if (!interrupted) @@ -1567,8 +1567,9 @@ int cmd_call(char *call[], int mode) usleep(100000); continue; } - if (errno != ENOTCONN) - perror("read"); + if (errno == ENOTCONN) + goto out_fd; + perror("read"); break; } if (gp.dwn_cnt != 0) { @@ -1690,6 +1691,7 @@ int cmd_call(char *call[], int mode) } while (restbytes != 0); } +out_fd: if (FD_ISSET(STDIN_FILENO, &sock_read)) { if ((mode & RAWMODE) == RAWMODE) { /* bytes = read(STDIN_FILENO, buf, 511); */ |