mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-05-26 15:55:42 -04:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21cde2888c | ||
|
|
4a7481889c | ||
|
|
0adb99b9dc | ||
|
|
36349ea0be |
7
io.c
7
io.c
@@ -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
7
main.c
@@ -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]);
|
||||
|
||||
@@ -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
23
util.c
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user