Compare commits

..

4 Commits

Author SHA1 Message Date
rsync-bugs
21cde2888c preparing for release of 2.4.3 2000-04-09 02:53:57 +00:00
Andrew Tridgell
4a7481889c use 1 second sleeps in the sleep loop as some OSes (NT for example)
don't get interrupted during a sleep.
2000-04-09 02:32:57 +00:00
Andrew Tridgell
0adb99b9dc don't pprint the IO timeout message if we are a server or daemon (can
cause recursive error messages)
2000-04-09 02:32:18 +00:00
Andrew Tridgell
36349ea0be a very simple fix - if I'd only thought if it last week :)
rsh relies on stdin being blocking
ssh relies on stdout being non-blocking

what we've done before is to set both stdin and stdout to either
blocking or non-blocking. Now I set stdin to blocking and stdout to
non-blocking. This seems to fix all cases I've tested.
2000-04-09 02:16:42 +00:00
5 changed files with 30 additions and 13 deletions

7
io.c
View File

@@ -49,6 +49,7 @@ void setup_readbuffer(int f_in)
static void check_timeout(void)
{
extern int am_server, am_daemon;
time_t t;
if (!io_timeout) return;
@@ -61,8 +62,10 @@ static void check_timeout(void)
t = time(NULL);
if (last_io && io_timeout && (t-last_io) >= io_timeout) {
rprintf(FERROR,"io timeout after %d second - exiting\n",
(int)(t-last_io));
if (!am_server && !am_daemon) {
rprintf(FERROR,"io timeout after %d second - exiting\n",
(int)(t-last_io));
}
exit_cleanup(RERR_TIMEOUT);
}
}

7
main.c
View File

@@ -324,9 +324,10 @@ static int do_recv(int f_in,int f_out,struct file_list *flist,char *local_name)
write_int(recv_pipe[1],1);
close(recv_pipe[1]);
io_flush();
/* finally we go to sleep until our parent kills us with
a USR2 signal */
while (1) sleep(60);
/* finally we go to sleep until our parent kills us
with a USR2 signal. We sleepp for a short time as on
some OSes a signal won't interrupt a sleep! */
while (1) sleep(1);
}
close(recv_pipe[1]);

View File

@@ -1,10 +1,10 @@
Summary: Program for efficient remote updates of files.
Name: rsync
Version: 2.4.2
Version: 2.4.3
Release: 1
Copyright: GPL
Group: Applications/Networking
Source: ftp://samba.anu.edu.au/pub/rsync/rsync-2.4.2.tar.gz
Source: ftp://samba.anu.edu.au/pub/rsync/rsync-2.4.3.tar.gz
URL: http://samba.anu.edu.au/rsync/
Packager: Andrew Tridgell <tridge@samba.anu.edu.au>
BuildRoot: /tmp/rsync

23
util.c
View File

@@ -28,10 +28,7 @@ extern int verbose;
/****************************************************************************
Set a fd into nonblocking mode. Uses POSIX O_NONBLOCK if available,
else
if SYSV use O_NDELAY
if BSD use FNDELAY
Set a fd into nonblocking mode
****************************************************************************/
void set_nonblocking(int fd)
{
@@ -45,6 +42,21 @@ void set_nonblocking(int fd)
}
}
/****************************************************************************
Set a fd into blocking mode
****************************************************************************/
void set_blocking(int fd)
{
int val;
if((val = fcntl(fd, F_GETFL, 0)) == -1)
return;
if (val & NONBLOCK_FLAG) {
val &= ~NONBLOCK_FLAG;
fcntl(fd, F_SETFL, val);
}
}
/* create a file descriptor pair - like pipe() but use socketpair if
possible (because of blocking issues on pipes)
@@ -70,7 +82,7 @@ int fd_pair(int fd[2])
}
/* this is taken from CVS */
/* this is derived from CVS code */
int piped_child(char **command,int *f_in,int *f_out)
{
int pid;
@@ -103,6 +115,7 @@ int piped_child(char **command,int *f_in,int *f_out)
if (to_child_pipe[0] != STDIN_FILENO) close(to_child_pipe[0]);
if (from_child_pipe[1] != STDOUT_FILENO) close(from_child_pipe[1]);
umask(orig_umask);
set_blocking(STDIN_FILENO);
execvp(command[0], command);
rprintf(FERROR,"Failed to exec %s : %s\n",
command[0],strerror(errno));

View File

@@ -1 +1 @@
#define VERSION "2.4.2"
#define VERSION "2.4.3"