Diff between a9d1f6f6a625607de6c3f5b7a40a3aac5f36c02b and eb057846cf0304c5faec30f510965f9071d45e57
Changed Files
| File | Additions | Deletions | Status |
| tools/isotest.c | +2 | -2 | modified |
Full Patch
diff --git a/tools/isotest.c b/tools/isotest.c
index 771d24b..7e875fa 100644
--- a/tools/isotest.c
+++ b/tools/isotest.c
@@ -642,7 +642,7 @@ static void dump_mode(int fd, int sk, char *peer)
}
syslog(LOG_INFO, "Receiving ...");
- while ((len = read(sk, buf, data_size)) > 0) {
+ while ((len = read(sk, buf, data_size)) >= 0) {
if (fd >= 0) {
len = write(fd, buf, len);
if (len < 0) {
@@ -680,7 +680,7 @@ static void recv_mode(int fd, int sk, char *peer)
int r;
r = recv(sk, buf, data_size, 0);
- if (r <= 0) {
+ if (r < 0) {
if (r < 0)
syslog(LOG_ERR, "Read failed: %s (%d)",
strerror(errno), errno);