extern int keep_dirlinks;
extern int preserve_hard_links;
extern int protocol_version;
extern int keep_dirlinks;
extern int preserve_hard_links;
extern int protocol_version;
struct file_list *the_file_list;
/* There's probably never more than at most 2 outstanding child processes,
* but set it higher, just in case. */
struct file_list *the_file_list;
/* There's probably never more than at most 2 outstanding child processes,
* but set it higher, just in case. */
} pid_stat_table[MAXCHILDPROCS];
static time_t starttime, endtime;
} pid_stat_table[MAXCHILDPROCS];
static time_t starttime, endtime;
/* Status of requested child no longer available: check to
* see if it was processed by sigchld_handler(). */
int cnt;
/* Status of requested child no longer available: check to
* see if it was processed by sigchld_handler(). */
int cnt;
if (pid == pid_stat_table[cnt].pid) {
*status_ptr = pid_stat_table[cnt].status;
pid_stat_table[cnt].pid = 0;
if (pid == pid_stat_table[cnt].pid) {
*status_ptr = pid_stat_table[cnt].status;
pid_stat_table[cnt].pid = 0;
* appropriate error message. Perhaps we should also accept a
* message describing the purpose of the child. Also indicate
* this to the caller so that they know something went wrong. */
* appropriate error message. Perhaps we should also accept a
* message describing the purpose of the child. Also indicate
* this to the caller so that they know something went wrong. */
- if (waited_pid < 0)
- *code_ptr = RERR_WAITCHILD;
- else if (!WIFEXITED(status)) {
+ if (waited_pid < 0) {
+ rsyserr(FERROR, errno, "waitpid");
+ *exit_code_ptr = RERR_WAITCHILD;
+ } else if (!WIFEXITED(status)) {
static int do_recv(int f_in,int f_out,struct file_list *flist,char *local_name)
{
int pid;
static int do_recv(int f_in,int f_out,struct file_list *flist,char *local_name)
{
int pid;
}
static void do_server_recv(int f_in, int f_out, int argc,char *argv[])
{
}
static void do_server_recv(int f_in, int f_out, int argc,char *argv[])
{
- status = do_recv(f_in,f_out,flist,local_name);
- exit_cleanup(status);
+ exit_code = do_recv(f_in,f_out,flist,local_name);
+ exit_cleanup(exit_code);
int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[])
{
struct file_list *flist = NULL;
int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[])
{
struct file_list *flist = NULL;
if (flist && flist->count > 0) {
local_name = get_local_name(flist, argv[0]);
if (flist && flist->count > 0) {
local_name = get_local_name(flist, argv[0]);
- status2 = do_recv(f_in, f_out, flist, local_name);
+ exit_code2 = do_recv(f_in, f_out, flist, local_name);