Bugzilla – Attachment 688 Details for
Bug 897
scp doesn't clean up forked children when processing multiple files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
3rd attempt at a bug-free patch :-(
scp.c.antizombie.patch3 (text/plain), 2.30 KB, created by
Stephen Riehm
on 2004-07-21 01:47:17 AEST
(
hide
)
Description:
3rd attempt at a bug-free patch :-(
Filename:
MIME Type:
Creator:
Stephen Riehm
Created:
2004-07-21 01:47:17 AEST
Size:
2.30 KB
patch
obsolete
>*** scp.c.ckpt Tue Jul 20 17:35:34 2004 >--- scp.c Tue Jul 20 17:37:10 2004 >*************** >*** 333,361 **** > > (void) signal(SIGPIPE, lostconn); > >! if ((targ = colon(argv[argc - 1]))) /* Dest is remote host. */ > toremote(targ, argc, argv); >! else { > tolocal(argc, argv); /* Dest is local host. */ > if (targetshouldbedirectory) > verifydir(argv[argc - 1]); > } >- /* >- * Finally check the exit status of the ssh process, if one was forked >- * and no error has occured yet >- */ >- if (do_cmd_pid != -1 && errs == 0) { >- if (remin != -1) >- (void) close(remin); >- if (remout != -1) >- (void) close(remout); >- if (waitpid(do_cmd_pid, &status, 0) == -1) >- errs = 1; >- else { >- if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) >- errs = 1; >- } >- } > exit(errs != 0); > } > >--- 333,361 ---- > > (void) signal(SIGPIPE, lostconn); > >! if ((targ = colon(argv[argc - 1]))) { /* Dest is remote host. */ > toremote(targ, argc, argv); >! /* >! * Finally check the exit status of the ssh process, if one was forked >! * and no error has occured yet >! */ >! if (do_cmd_pid != -1 && errs == 0) { >! if (remin != -1) >! (void) close(remin); >! if (remout != -1) >! (void) close(remout); >! if (waitpid(do_cmd_pid, &status, 0) == -1) >! errs = 1; >! else { >! if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) >! errs = 1; >! } >! } >! } else { > tolocal(argc, argv); /* Dest is local host. */ > if (targetshouldbedirectory) > verifydir(argv[argc - 1]); > } > exit(errs != 0); > } > >*************** >*** 451,457 **** > void > tolocal(int argc, char **argv) > { >! int i, len; > char *bp, *host, *src, *suser; > > for (i = 0; i < argc - 1; i++) { >--- 451,457 ---- > void > tolocal(int argc, char **argv) > { >! int i, len, status; > char *bp, *host, *src, *suser; > > for (i = 0; i < argc - 1; i++) { >*************** >*** 494,499 **** >--- 494,511 ---- > sink(1, argv + argc - 1); > (void) close(remin); > remin = remout = -1; >+ if (do_cmd_pid != -1 && errs == 0) { >+ if (remin != -1) >+ (void) close(remin); >+ if (remout != -1) >+ (void) close(remout); >+ if (waitpid(do_cmd_pid, &status, 0) == -1) >+ errs = 1; >+ else { >+ if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) >+ errs = 1; >+ } >+ } > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 897
:
686
|
687
|
688
|
695