Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
final change needed to get rsync working on a CRAY J90
[rsync/rsync.git]
/
io.c
diff --git
a/io.c
b/io.c
index
3ea09e1
..
9f6b228
100644
(file)
--- a/
io.c
+++ b/
io.c
@@
-70,6
+70,7
@@
static char *read_buffer_p;
static int read_buffer_len;
static int read_buffer_size;
static int no_flush;
static int read_buffer_len;
static int read_buffer_size;
static int no_flush;
+static int no_flush_read;
/* read from a socket with IO timeout. return the number of
bytes read. If no bytes can be read then exit, never return
/* read from a socket with IO timeout. return the number of
bytes read. If no bytes can be read then exit, never return
@@
-78,7
+79,9
@@
static int read_timeout(int fd, char *buf, int len)
{
int n, ret=0;
{
int n, ret=0;
+ no_flush_read++;
io_flush();
io_flush();
+ no_flush_read--;
while (ret == 0) {
fd_set fds;
while (ret == 0) {
fd_set fds;
@@
-254,7
+257,9
@@
static void readfd(int fd,char *buffer,int N)
continue;
}
continue;
}
+ no_flush_read++;
io_flush();
io_flush();
+ no_flush_read--;
ret = read_unbuffered(fd,buffer + total,N-total);
total += ret;
ret = read_unbuffered(fd,buffer + total,N-total);
total += ret;
@@
-265,8
+270,12
@@
static void readfd(int fd,char *buffer,int N)
int32 read_int(int f)
{
char b[4];
int32 read_int(int f)
{
char b[4];
+ int32 ret;
+
readfd(f,b,4);
readfd(f,b,4);
- return IVAL(b,0);
+ ret = IVAL(b,0);
+ if (ret == (int32)0xffffffff) return -1;
+ return ret;
}
int64 read_longint(int f)
}
int64 read_longint(int f)
@@
-276,7
+285,9
@@
int64 read_longint(int f)
char b[8];
ret = read_int(f);
char b[8];
ret = read_int(f);
- if ((int32)ret != (int32)0xffffffff) return ret;
+ if ((int32)ret != (int32)0xffffffff) {
+ return ret;
+ }
#ifdef NO_INT64
rprintf(FERROR,"Integer overflow - attempted 64 bit offset\n");
#ifdef NO_INT64
rprintf(FERROR,"Integer overflow - attempted 64 bit offset\n");
@@
-320,7
+331,7
@@
static void writefd_unbuffered(int fd,char *buf,int len)
fd_set w_fds, r_fds;
int fd_count, count;
struct timeval tv;
fd_set w_fds, r_fds;
int fd_count, count;
struct timeval tv;
- int reading;
+ int reading
=0
;
int blocked=0;
no_flush++;
int blocked=0;
no_flush++;
@@
-331,8
+342,9
@@
static void writefd_unbuffered(int fd,char *buf,int len)
FD_SET(fd,&w_fds);
fd_count = fd+1;
FD_SET(fd,&w_fds);
fd_count = fd+1;
- reading = (buffer_f_in != -1 &&
- read_buffer_len < MAX_READ_BUFFER);
+ if (!no_flush_read) {
+ reading = (buffer_f_in != -1);
+ }
if (reading) {
FD_SET(buffer_f_in,&r_fds);
if (reading) {
FD_SET(buffer_f_in,&r_fds);
@@
-465,7
+477,7
@@
void write_longint(int f, int64 x)
return;
}
return;
}
- write_int(f,
-1
);
+ write_int(f,
(int32)0xFFFFFFFF
);
SIVAL(b,0,(x&0xFFFFFFFF));
SIVAL(b,4,((x>>32)&0xFFFFFFFF));
SIVAL(b,0,(x&0xFFFFFFFF));
SIVAL(b,4,((x>>32)&0xFFFFFFFF));
@@
-478,7
+490,7
@@
void write_buf(int f,char *buf,int len)
}
/* write a string to the connection */
}
/* write a string to the connection */
-void write_sbuf(int f,char *buf)
+
static
void write_sbuf(int f,char *buf)
{
write_buf(f, buf, strlen(buf));
}
{
write_buf(f, buf, strlen(buf));
}