rem: batch_fd = do_open(batch_prefix,
add: batch_fd = do_open(batch_name,
context: int main(int argc,char *argv[]){	int ret;	int orig_argc;	char **orig_argv;	orig_argc = argc;	orig_argv = argv;	signal(SIGUSR1, sigusr1_handler);	signal(SIGUSR2, sigusr2_handler);	signal(SIGCHLD, sigchld_handler);#ifdef MAINTAINER_MODE	signal(SIGSEGV, rsync_panic_handler);	signal(SIGFPE, rsync_panic_handler);	signal(SIGABRT, rsync_panic_handler);	signal(SIGBUS, rsync_panic_handler);#endif /* def MAINTAINER_MODE */	starttime = time(NULL);	am_root = (MY_UID() == 0);	memset(&stats, 0, sizeof(stats));	if (argc < 2) {		usage(FERROR);		exit_cleanup(RERR_SYNTAX);	}	/* we set a 0 umask so that correct file permissions can be	 * carried across */	orig_umask = (int)umask(0);	if (!parse_arguments(&argc, (const char ***) &argv, 1)) {		/* FIXME: We ought to call the same error-handling		 * code here, rather than relying on getopt. */		option_error();		exit_cleanup(RERR_SYNTAX);	}	signal(SIGINT,SIGNAL_CAST sig_int);	signal(SIGHUP,SIGNAL_CAST sig_int);	signal(SIGTERM,SIGNAL_CAST sig_int);	/* Ignore SIGPIPE; we consistently check error codes and will	 * see the EPIPE. */	signal(SIGPIPE, SIG_IGN);	/* Initialize push_dir here because on some old systems getcwd	 * (implemented by forking "pwd" and reading its output) doesn't	 * work when there are other child processes.  Also, on all systems	 * that implement getcwd that way "pwd" can't be found after chroot. */	push_dir(NULL);	init_flist();	if (write_batch || read_batch) {		if (write_batch)			write_batch_argvs_file(orig_argc, orig_argv);		batch_fd = do_open(batch_prefix,				   write_batch ? O_WRONLY | O_CREAT | O_TRUNC				   : O_RDONLY, S_IRUSR | S_IWUSR);		if (batch_fd < 0) {			rsyserr(FERROR, errno, "Batch file %s open error",				batch_prefix);			exit_cleanup(RERR_FILEIO);		}	}	if (am_daemon && !am_server)		return daemon_main();	if (argc < 1) {		usage(FERROR);		exit_cleanup(RERR_SYNTAX);	}	if (dry_run)		verbose = MAX(verbose,1);	if (am_server) {		set_nonblocking(STDIN_FILENO);		set_nonblocking(STDOUT_FILENO);		if (am_daemon)			return start_daemon(STDIN_FILENO, STDOUT_FILENO);		start_server(STDIN_FILENO, STDOUT_FILENO, argc, argv);	}	ret = start_client(argc, argv);	if (ret == -1)		exit_cleanup(RERR_STARTCLIENT);	else		exit_cleanup(ret);	return ret;}