Fixed bug in receiving 32kB compressible files
[rsync/rsync.git] / main.c
CommitLineData
c627d613
AT
1/*
2 Copyright (C) Andrew Tridgell 1996
3 Copyright (C) Paul Mackerras 1996
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18*/
19
20#include "rsync.h"
21
22int verbose = 0;
23int always_checksum = 0;
24time_t starttime;
25off_t total_size = 0;
26int block_size=BLOCK_SIZE;
27
28char *backup_suffix = BACKUP_SUFFIX;
29
30static char *rsync_path = RSYNC_NAME;
31
32int make_backups = 0;
33int preserve_links = 0;
dc5ddbcc 34int preserve_hard_links = 0;
c627d613
AT
35int preserve_perms = 0;
36int preserve_devices = 0;
37int preserve_uid = 0;
38int preserve_gid = 0;
39int preserve_times = 0;
40int update_only = 0;
41int cvs_exclude = 0;
42int dry_run=0;
43int local_server=0;
44int ignore_times=0;
45int delete_mode=0;
46int one_file_system=0;
4fe159a8 47int remote_version=0;
dc5ddbcc 48int sparse_files=0;
70d794dc 49int do_compression=0;
7b8356d0
AT
50int am_root=0;
51int orig_umask=0;
70d794dc 52
34ccb63e 53extern int csum_length;
c627d613
AT
54
55int am_server = 0;
56static int sender = 0;
57int recurse = 0;
58
59static void usage(FILE *f);
60
61static void report(int f)
62{
63 int in,out,tsize;
64 time_t t = time(NULL);
65
66 if (!verbose) return;
67
68 if (am_server && sender) {
69 write_int(f,read_total());
70 write_int(f,write_total());
71 write_int(f,total_size);
72 write_flush(f);
73 return;
74 }
75
76 if (sender) {
77 in = read_total();
78 out = write_total();
79 tsize = (int)total_size;
80 } else {
81 in = read_int(f);
82 out = read_int(f);
83 tsize = read_int(f);
84 }
85
86 printf("wrote %d bytes read %d bytes %g bytes/sec\n",
87 out,in,(in+out)/(0.5 + (t-starttime)));
88 printf("total size is %d speedup is %g\n",
89 tsize,(1.0*tsize)/(in+out));
90}
91
92
93static void server_options(char **args,int *argc)
94{
95 int ac = *argc;
96 static char argstr[50];
97 static char bsize[30];
98 int i, x;
99
100 args[ac++] = "--server";
101
102 if (!sender)
103 args[ac++] = "--sender";
104
105 x = 1;
106 argstr[0] = '-';
107 for (i=0;i<verbose;i++)
108 argstr[x++] = 'v';
109 if (make_backups)
110 argstr[x++] = 'b';
111 if (update_only)
112 argstr[x++] = 'u';
113 if (dry_run)
114 argstr[x++] = 'n';
115 if (preserve_links)
116 argstr[x++] = 'l';
dc5ddbcc
AT
117 if (preserve_hard_links)
118 argstr[x++] = 'H';
c627d613
AT
119 if (preserve_uid)
120 argstr[x++] = 'o';
121 if (preserve_gid)
122 argstr[x++] = 'g';
123 if (preserve_devices)
124 argstr[x++] = 'D';
125 if (preserve_times)
126 argstr[x++] = 't';
127 if (preserve_perms)
128 argstr[x++] = 'p';
129 if (recurse)
130 argstr[x++] = 'r';
131 if (always_checksum)
132 argstr[x++] = 'c';
133 if (cvs_exclude)
134 argstr[x++] = 'C';
135 if (ignore_times)
136 argstr[x++] = 'I';
137 if (one_file_system)
138 argstr[x++] = 'x';
dc5ddbcc
AT
139 if (sparse_files)
140 argstr[x++] = 'S';
861c20b4
PM
141 if (do_compression)
142 argstr[x++] = 'z';
c627d613
AT
143 argstr[x] = 0;
144
145 if (x != 1) args[ac++] = argstr;
146
147 if (block_size != BLOCK_SIZE) {
148 sprintf(bsize,"-B%d",block_size);
149 args[ac++] = bsize;
150 }
43a481dc 151
c627d613
AT
152 if (delete_mode)
153 args[ac++] = "--delete";
154
155 *argc = ac;
156}
157
158
159
160int do_cmd(char *cmd,char *machine,char *user,char *path,int *f_in,int *f_out)
161{
162 char *args[100];
163 int i,argc=0;
164 char *tok,*p;
165
166 if (!local_server) {
167 if (!cmd)
168 cmd = getenv(RSYNC_RSH_ENV);
169 if (!cmd)
170 cmd = RSYNC_RSH;
171 cmd = strdup(cmd);
172 if (!cmd)
173 goto oom;
174
175 for (tok=strtok(cmd," ");tok;tok=strtok(NULL," ")) {
176 args[argc++] = tok;
177 }
178
7b8356d0
AT
179#if HAVE_REMSH
180 /* remsh (on HPUX) takes the arguments the other way around */
181 args[argc++] = machine;
182 if (user) {
183 args[argc++] = "-l";
184 args[argc++] = user;
185 }
186#else
c627d613
AT
187 if (user) {
188 args[argc++] = "-l";
189 args[argc++] = user;
190 }
191 args[argc++] = machine;
7b8356d0 192#endif
c627d613
AT
193 }
194
195 args[argc++] = rsync_path;
196
197 server_options(args,&argc);
198
199 if (path && *path) {
200 char *dir = strdup(path);
201 p = strrchr(dir,'/');
202 if (p) {
203 *p = 0;
7b8356d0
AT
204 if (!dir[0])
205 args[argc++] = "/";
206 else
207 args[argc++] = dir;
c627d613
AT
208 p++;
209 } else {
210 args[argc++] = ".";
211 p = dir;
212 }
213 if (p[0])
214 args[argc++] = path;
215 }
216
217 args[argc] = NULL;
218
219 if (verbose > 3) {
dc5ddbcc 220 fprintf(FERROR,"cmd=");
c627d613 221 for (i=0;i<argc;i++)
dc5ddbcc
AT
222 fprintf(FERROR,"%s ",args[i]);
223 fprintf(FERROR,"\n");
c627d613
AT
224 }
225
226 return piped_child(args,f_in,f_out);
227
228oom:
229 out_of_memory("do_cmd");
230 return 0; /* not reached */
231}
232
233
234
235
236static char *get_local_name(struct file_list *flist,char *name)
237{
238 struct stat st;
239
240 if (stat(name,&st) == 0) {
241 if (S_ISDIR(st.st_mode)) {
242 if (chdir(name) != 0) {
dc5ddbcc 243 fprintf(FERROR,"chdir %s : %s\n",name,strerror(errno));
34ccb63e 244 exit_cleanup(1);
c627d613
AT
245 }
246 return NULL;
247 }
248 if (flist->count > 1) {
dc5ddbcc 249 fprintf(FERROR,"ERROR: destination must be a directory when copying more than 1 file\n");
34ccb63e 250 exit_cleanup(1);
c627d613
AT
251 }
252 return name;
253 }
254
255 if (flist->count == 1)
256 return name;
257
258 if (!name)
259 return NULL;
260
7b8356d0 261 if (mkdir(name,0777 & ~orig_umask) != 0) {
dc5ddbcc 262 fprintf(FERROR,"mkdir %s : %s\n",name,strerror(errno));
34ccb63e 263 exit_cleanup(1);
94481d91 264 } else {
dc5ddbcc 265 fprintf(FINFO,"created directory %s\n",name);
c627d613
AT
266 }
267
268 if (chdir(name) != 0) {
dc5ddbcc 269 fprintf(FERROR,"chdir %s : %s\n",name,strerror(errno));
34ccb63e 270 exit_cleanup(1);
c627d613
AT
271 }
272
273 return NULL;
274}
275
276
277
278
279void do_server_sender(int argc,char *argv[])
280{
281 int i;
282 char *dir = argv[0];
283 struct file_list *flist;
284
285 if (verbose > 2)
dc5ddbcc 286 fprintf(FERROR,"server_sender starting pid=%d\n",(int)getpid());
c627d613
AT
287
288 if (chdir(dir) != 0) {
dc5ddbcc 289 fprintf(FERROR,"chdir %s: %s\n",dir,strerror(errno));
34ccb63e 290 exit_cleanup(1);
c627d613
AT
291 }
292 argc--;
293 argv++;
294
295 if (strcmp(dir,".")) {
296 int l = strlen(dir);
8bf73749
AT
297 if (strcmp(dir,"/") == 0)
298 l = 0;
c627d613
AT
299 for (i=0;i<argc;i++)
300 argv[i] += l+1;
301 }
302
303 if (argc == 0 && recurse) {
304 argc=1;
305 argv--;
306 argv[0] = ".";
307 }
308
309
a06d19e3 310 flist = send_file_list(STDOUT_FILENO,argc,argv);
c627d613
AT
311 send_files(flist,STDOUT_FILENO,STDIN_FILENO);
312 report(STDOUT_FILENO);
34ccb63e 313 exit_cleanup(0);
c627d613
AT
314}
315
316
dc5ddbcc
AT
317static int do_recv(int f_in,int f_out,struct file_list *flist,char *local_name)
318{
319 int pid;
320 int status=0;
c6e7fcb4 321 int recv_pipe[2];
dc5ddbcc
AT
322
323 if (preserve_hard_links)
324 init_hard_links(flist);
325
c6e7fcb4
AT
326 if (pipe(recv_pipe) < 0) {
327 fprintf(FERROR,"pipe failed in do_recv\n");
328 exit(1);
329 }
330
331
dc5ddbcc 332 if ((pid=fork()) == 0) {
c6e7fcb4 333 recv_files(f_in,flist,local_name,recv_pipe[1]);
dc5ddbcc
AT
334 if (preserve_hard_links)
335 do_hard_links(flist);
336 if (verbose > 2)
337 fprintf(FERROR,"receiver read %d\n",read_total());
338 exit_cleanup(0);
339 }
340
c6e7fcb4 341 generate_files(f_out,flist,local_name,recv_pipe[0]);
dc5ddbcc
AT
342
343 waitpid(pid, &status, 0);
344
345 return status;
346}
347
c627d613
AT
348
349void do_server_recv(int argc,char *argv[])
350{
dc5ddbcc 351 int status;
c627d613
AT
352 char *dir = NULL;
353 struct file_list *flist;
354 char *local_name=NULL;
355
356 if (verbose > 2)
dc5ddbcc 357 fprintf(FERROR,"server_recv(%d) starting pid=%d\n",argc,(int)getpid());
c627d613
AT
358
359 if (argc > 0) {
360 dir = argv[0];
361 argc--;
362 argv++;
363 if (chdir(dir) != 0) {
dc5ddbcc 364 fprintf(FERROR,"chdir %s : %s\n",dir,strerror(errno));
34ccb63e 365 exit_cleanup(1);
c627d613
AT
366 }
367 }
368
369 if (delete_mode)
370 recv_exclude_list(STDIN_FILENO);
371
372 flist = recv_file_list(STDIN_FILENO);
373 if (!flist || flist->count == 0) {
dc5ddbcc 374 fprintf(FERROR,"nothing to do\n");
34ccb63e 375 exit_cleanup(1);
c627d613
AT
376 }
377
378 if (argc > 0) {
379 if (strcmp(dir,".")) {
380 argv[0] += strlen(dir);
381 if (argv[0][0] == '/') argv[0]++;
382 }
383 local_name = get_local_name(flist,argv[0]);
384 }
385
dc5ddbcc 386 status = do_recv(STDIN_FILENO,STDOUT_FILENO,flist,local_name);
34ccb63e 387 exit_cleanup(status);
c627d613
AT
388}
389
390
391static void usage(FILE *f)
392{
393 fprintf(f,"rsync version %s Copyright Andrew Tridgell and Paul Mackerras\n\n",
394 VERSION);
395 fprintf(f,"Usage:\t%s [options] src user@host:dest\nOR",RSYNC_NAME);
396 fprintf(f,"\t%s [options] user@host:src dest\n\n",RSYNC_NAME);
397 fprintf(f,"Options:\n");
398 fprintf(f,"-v, --verbose increase verbosity\n");
399 fprintf(f,"-c, --checksum always checksum\n");
400 fprintf(f,"-a, --archive archive mode (same as -rlptDog)\n");
401 fprintf(f,"-r, --recursive recurse into directories\n");
402 fprintf(f,"-b, --backup make backups (default ~ extension)\n");
403 fprintf(f,"-u, --update update only (don't overwrite newer files)\n");
404 fprintf(f,"-l, --links preserve soft links\n");
dc5ddbcc 405 fprintf(f,"-H, --hard-links preserve hard links\n");
c627d613
AT
406 fprintf(f,"-p, --perms preserve permissions\n");
407 fprintf(f,"-o, --owner preserve owner (root only)\n");
408 fprintf(f,"-g, --group preserve group\n");
409 fprintf(f,"-D, --devices preserve devices (root only)\n");
410 fprintf(f,"-t, --times preserve times\n");
dc5ddbcc 411 fprintf(f,"-S, --sparse handle sparse files efficiently\n");
c627d613
AT
412 fprintf(f,"-n, --dry-run show what would have been transferred\n");
413 fprintf(f,"-x, --one-file-system don't cross filesystem boundaries\n");
414 fprintf(f,"-B, --block-size SIZE checksum blocking size\n");
415 fprintf(f,"-e, --rsh COMMAND specify rsh replacement\n");
416 fprintf(f," --rsync-path PATH specify path to rsync on the remote machine\n");
417 fprintf(f,"-C, --cvs-exclude auto ignore files in the same way CVS does\n");
418 fprintf(f," --delete delete files that don't exist on the sending side\n");
419 fprintf(f,"-I, --ignore-times don't exclude files that match length and time\n");
861c20b4 420 fprintf(f,"-z, --compress compress file data\n");
c627d613
AT
421 fprintf(f," --exclude FILE exclude file FILE\n");
422 fprintf(f," --exclude-from FILE exclude files listed in FILE\n");
423 fprintf(f," --suffix SUFFIX override backup suffix\n");
424 fprintf(f," --version print version number\n");
425
426 fprintf(f,"\n");
427 fprintf(f,"the backup suffix defaults to %s\n",BACKUP_SUFFIX);
428 fprintf(f,"the block size defaults to %d\n",BLOCK_SIZE);
429}
430
431enum {OPT_VERSION,OPT_SUFFIX,OPT_SENDER,OPT_SERVER,OPT_EXCLUDE,
b98c7b81 432 OPT_EXCLUDE_FROM,OPT_DELETE,OPT_RSYNC_PATH};
c627d613 433
861c20b4 434static char *short_options = "oblHpguDCtcahvrIxnSe:B:z";
c627d613
AT
435
436static struct option long_options[] = {
437 {"version", 0, 0, OPT_VERSION},
438 {"server", 0, 0, OPT_SERVER},
439 {"sender", 0, 0, OPT_SENDER},
440 {"delete", 0, 0, OPT_DELETE},
441 {"exclude", 1, 0, OPT_EXCLUDE},
442 {"exclude-from",1, 0, OPT_EXCLUDE_FROM},
443 {"rsync-path", 1, 0, OPT_RSYNC_PATH},
444 {"one-file-system",0, 0, 'x'},
445 {"ignore-times",0, 0, 'I'},
446 {"help", 0, 0, 'h'},
447 {"dry-run", 0, 0, 'n'},
dc5ddbcc 448 {"sparse", 0, 0, 'S'},
c627d613
AT
449 {"cvs-exclude", 0, 0, 'C'},
450 {"archive", 0, 0, 'a'},
451 {"checksum", 0, 0, 'c'},
452 {"backup", 0, 0, 'b'},
453 {"update", 0, 0, 'u'},
454 {"verbose", 0, 0, 'v'},
455 {"recursive", 0, 0, 'r'},
456 {"devices", 0, 0, 'D'},
457 {"perms", 0, 0, 'p'},
458 {"links", 0, 0, 'l'},
dc5ddbcc 459 {"hard-links", 0, 0, 'H'},
c627d613
AT
460 {"owner", 0, 0, 'o'},
461 {"group", 0, 0, 'g'},
462 {"times", 0, 0, 't'},
463 {"rsh", 1, 0, 'e'},
464 {"suffix", 1, 0, OPT_SUFFIX},
465 {"block-size", 1, 0, 'B'},
861c20b4 466 {"compress", 0, 0, 'z'},
c627d613
AT
467 {0,0,0,0}};
468
469int main(int argc,char *argv[])
470{
dc5ddbcc 471 int pid, status, status2;
c627d613
AT
472 int opt;
473 int option_index;
474 char *shell_cmd = NULL;
475 char *shell_machine = NULL;
476 char *shell_path = NULL;
477 char *shell_user = NULL;
478 char *p;
479 int f_in,f_out;
480 struct file_list *flist;
481 char *local_name = NULL;
482
483 starttime = time(NULL);
7b8356d0
AT
484 am_root = (getuid() == 0);
485
486 /* we set a 0 umask so that correct file permissions can be
487 carried across */
488 orig_umask = umask(0);
c627d613
AT
489
490 while ((opt = getopt_long(argc, argv,
491 short_options, long_options, &option_index))
492 != -1) {
493 switch (opt)
494 {
495 case OPT_VERSION:
496 printf("rsync version %s protocol version %d\n",
497 VERSION,PROTOCOL_VERSION);
34ccb63e 498 exit_cleanup(0);
c627d613
AT
499
500 case OPT_SUFFIX:
501 backup_suffix = optarg;
502 break;
503
504 case OPT_RSYNC_PATH:
505 rsync_path = optarg;
506 break;
507
508 case 'I':
509 ignore_times = 1;
510 break;
511
512 case 'x':
513 one_file_system=1;
514 break;
515
516 case OPT_DELETE:
517 delete_mode = 1;
518 break;
519
520 case OPT_EXCLUDE:
521 add_exclude(optarg);
522 break;
523
524 case OPT_EXCLUDE_FROM:
525 add_exclude_file(optarg,1);
526 break;
527
528 case 'h':
dc5ddbcc 529 usage(FINFO);
34ccb63e 530 exit_cleanup(0);
c627d613
AT
531
532 case 'b':
533 make_backups=1;
534 break;
535
536 case 'n':
537 dry_run=1;
538 break;
539
dc5ddbcc
AT
540 case 'S':
541 sparse_files=1;
542 break;
543
c627d613
AT
544 case 'C':
545 cvs_exclude=1;
546 break;
547
548 case 'u':
549 update_only=1;
550 break;
551
c627d613 552 case 'l':
dc5ddbcc 553#if SUPPORT_LINKS
c627d613 554 preserve_links=1;
dc5ddbcc 555#endif
c627d613 556 break;
dc5ddbcc
AT
557
558 case 'H':
559#if SUPPORT_HARD_LINKS
560 preserve_hard_links=1;
c627d613 561#endif
dc5ddbcc 562 break;
c627d613
AT
563
564 case 'p':
565 preserve_perms=1;
566 break;
567
568 case 'o':
7b8356d0 569 preserve_uid=1;
c627d613
AT
570 break;
571
572 case 'g':
573 preserve_gid=1;
574 break;
575
576 case 'D':
7b8356d0 577 preserve_devices=1;
c627d613
AT
578 break;
579
580 case 't':
581 preserve_times=1;
582 break;
583
584 case 'c':
585 always_checksum=1;
586 break;
587
588 case 'v':
589 verbose++;
590 break;
591
592 case 'a':
593 recurse=1;
594#if SUPPORT_LINKS
595 preserve_links=1;
596#endif
597 preserve_perms=1;
598 preserve_times=1;
599 preserve_gid=1;
7b8356d0 600 if (am_root) {
c627d613
AT
601 preserve_devices=1;
602 preserve_uid=1;
7b8356d0 603 }
c627d613
AT
604 break;
605
606 case OPT_SERVER:
607 am_server = 1;
608 break;
609
610 case OPT_SENDER:
611 if (!am_server) {
dc5ddbcc 612 usage(FERROR);
34ccb63e 613 exit_cleanup(1);
c627d613
AT
614 }
615 sender = 1;
616 break;
617
618 case 'r':
619 recurse = 1;
620 break;
621
622 case 'e':
623 shell_cmd = optarg;
624 break;
625
626 case 'B':
627 block_size = atoi(optarg);
628 break;
629
861c20b4
PM
630 case 'z':
631 do_compression = 1;
632 break;
633
c627d613 634 default:
861c20b4 635 /* fprintf(FERROR,"bad option -%c\n",opt); */
34ccb63e 636 exit_cleanup(1);
c627d613
AT
637 }
638 }
639
640 while (optind--) {
641 argc--;
642 argv++;
643 }
644
6b83141d
AT
645 signal(SIGCHLD,SIG_IGN);
646 signal(SIGINT,SIGNAL_CAST sig_int);
647 signal(SIGPIPE,SIGNAL_CAST sig_int);
648 signal(SIGHUP,SIGNAL_CAST sig_int);
649
c627d613
AT
650 if (dry_run)
651 verbose = MAX(verbose,1);
652
653 if (am_server) {
aae43eb3 654 setup_protocol(STDOUT_FILENO,STDIN_FILENO);
c627d613
AT
655
656 if (sender) {
657 recv_exclude_list(STDIN_FILENO);
658 if (cvs_exclude)
659 add_cvs_excludes();
660 do_server_sender(argc,argv);
661 } else {
662 do_server_recv(argc,argv);
663 }
34ccb63e 664 exit_cleanup(0);
c627d613
AT
665 }
666
667 if (argc < 2) {
dc5ddbcc 668 usage(FERROR);
34ccb63e 669 exit_cleanup(1);
c627d613
AT
670 }
671
672 p = strchr(argv[0],':');
673
674 if (p) {
675 sender = 0;
676 *p = 0;
677 shell_machine = argv[0];
678 shell_path = p+1;
679 argc--;
680 argv++;
681 } else {
682 sender = 1;
683
684 p = strchr(argv[argc-1],':');
685 if (!p) {
686 local_server = 1;
687 }
688
689 if (local_server) {
690 shell_machine = NULL;
691 shell_path = argv[argc-1];
692 } else {
693 *p = 0;
694 shell_machine = argv[argc-1];
695 shell_path = p+1;
696 }
697 argc--;
698 }
699
700 if (shell_machine) {
701 p = strchr(shell_machine,'@');
702 if (p) {
703 *p = 0;
704 shell_user = shell_machine;
705 shell_machine = p+1;
706 }
707 }
708
709 if (verbose > 3) {
dc5ddbcc 710 fprintf(FERROR,"cmd=%s machine=%s user=%s path=%s\n",
c627d613
AT
711 shell_cmd?shell_cmd:"",
712 shell_machine?shell_machine:"",
713 shell_user?shell_user:"",
714 shell_path?shell_path:"");
715 }
716
c627d613 717 if (!sender && argc != 1) {
dc5ddbcc 718 usage(FERROR);
34ccb63e 719 exit_cleanup(1);
c627d613
AT
720 }
721
722 pid = do_cmd(shell_cmd,shell_machine,shell_user,shell_path,&f_in,&f_out);
723
aae43eb3 724 setup_protocol(f_out,f_in);
4fe159a8 725
c627d613 726 if (verbose > 3)
dc5ddbcc 727 fprintf(FERROR,"parent=%d child=%d sender=%d recurse=%d\n",
c627d613
AT
728 (int)getpid(),pid,sender,recurse);
729
730 if (sender) {
731 if (cvs_exclude)
732 add_cvs_excludes();
733 if (delete_mode)
734 send_exclude_list(f_out);
a06d19e3 735 flist = send_file_list(f_out,argc,argv);
c627d613 736 if (verbose > 3)
dc5ddbcc 737 fprintf(FERROR,"file list sent\n");
c627d613
AT
738 send_files(flist,f_out,f_in);
739 if (verbose > 3)
dc5ddbcc 740 fprintf(FERROR,"waiting on %d\n",pid);
c627d613
AT
741 waitpid(pid, &status, 0);
742 report(-1);
34ccb63e 743 exit_cleanup(status);
c627d613
AT
744 }
745
746 send_exclude_list(f_out);
747
748 flist = recv_file_list(f_in);
749 if (!flist || flist->count == 0) {
dc5ddbcc 750 fprintf(FERROR,"nothing to do\n");
34ccb63e 751 exit_cleanup(0);
c627d613
AT
752 }
753
754 local_name = get_local_name(flist,argv[0]);
755
dc5ddbcc 756 status2 = do_recv(f_in,f_out,flist,local_name);
c627d613
AT
757
758 report(f_in);
759
760 waitpid(pid, &status, 0);
761
762 return status | status2;
763}