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
added --blocking-io option
[rsync/rsync.git]
/
util.c
diff --git
a/util.c
b/util.c
index
7c589b3
..
e4ebd25
100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-88,6
+88,7
@@
int piped_child(char **command,int *f_in,int *f_out)
int pid;
int to_child_pipe[2];
int from_child_pipe[2];
int pid;
int to_child_pipe[2];
int from_child_pipe[2];
+ extern int blocking_io;
if (fd_pair(to_child_pipe) < 0 ||
fd_pair(from_child_pipe) < 0) {
if (fd_pair(to_child_pipe) < 0 ||
fd_pair(from_child_pipe) < 0) {
@@
-116,6
+117,9
@@
int piped_child(char **command,int *f_in,int *f_out)
if (from_child_pipe[1] != STDOUT_FILENO) close(from_child_pipe[1]);
umask(orig_umask);
set_blocking(STDIN_FILENO);
if (from_child_pipe[1] != STDOUT_FILENO) close(from_child_pipe[1]);
umask(orig_umask);
set_blocking(STDIN_FILENO);
+ if (blocking_io) {
+ set_blocking(STDOUT_FILENO);
+ }
execvp(command[0], command);
rprintf(FERROR,"Failed to exec %s : %s\n",
command[0],strerror(errno));
execvp(command[0], command);
rprintf(FERROR,"Failed to exec %s : %s\n",
command[0],strerror(errno));