Bugzilla – Attachment 686 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]
patch to clean up forked processes before starting new ones
scp.c.antizombie.patch (text/plain), 2.47 KB, created by
Stephen Riehm
on 2004-07-20 23:33:22 AEST
(
hide
)
Description:
patch to clean up forked processes before starting new ones
Filename:
MIME Type:
Creator:
Stephen Riehm
Created:
2004-07-20 23:33:22 AEST
Size:
2.47 KB
patch
obsolete
>*** scp.c.ckpt Mon Nov 24 03:09:28 2003 >--- scp.c Tue Jul 20 15:32:11 2004 >*************** >*** 216,222 **** > int > main(int argc, char **argv) > { >! int ch, fflag, tflag, status; > double speed; > char *targ, *endp; > extern char *optarg; >--- 216,222 ---- > int > main(int argc, char **argv) > { >! int ch, fflag, tflag; > double speed; > char *targ, *endp; > extern char *optarg; >*************** >*** 340,368 **** > 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); > } > > void > toremote(char *targ, int argc, char **argv) > { >! int i, len; > char *bp, *host, *src, *suser, *thost, *tuser; > > *targ++ = 0; >--- 340,352 ---- > if (targetshouldbedirectory) > verifydir(argv[argc - 1]); > } > exit(errs != 0); > } > > void > toremote(char *targ, int argc, char **argv) > { >! int i, len, status; > char *bp, *host, *src, *suser, *thost, *tuser; > > *targ++ = 0; >*************** >*** 445,457 **** > } > source(1, argv + i); > } > } > } > > void > tolocal(int argc, char **argv) > { >! int i, len; > char *bp, *host, *src, *suser; > > for (i = 0; i < argc - 1; i++) { >--- 429,453 ---- > } > source(1, argv + i); > } >+ 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; >+ } >+ } > } > } > > void > tolocal(int argc, char **argv) > { >! int i, len, status; > char *bp, *host, *src, *suser; > > for (i = 0; i < argc - 1; i++) { >*************** >*** 494,499 **** >--- 490,507 ---- > 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