diff options
Diffstat (limited to 'scp.c')
-rw-r--r-- | scp.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -71,7 +71,7 @@ | |||
71 | */ | 71 | */ |
72 | 72 | ||
73 | #include "includes.h" | 73 | #include "includes.h" |
74 | RCSID("$OpenBSD: scp.c,v 1.122 2005/05/24 17:32:43 avsm Exp $"); | 74 | RCSID("$OpenBSD: scp.c,v 1.123 2005/05/26 02:08:05 avsm Exp $"); |
75 | 75 | ||
76 | #include "xmalloc.h" | 76 | #include "xmalloc.h" |
77 | #include "atomicio.h" | 77 | #include "atomicio.h" |
@@ -109,11 +109,13 @@ static void | |||
109 | killchild(int signo) | 109 | killchild(int signo) |
110 | { | 110 | { |
111 | if (do_cmd_pid > 1) { | 111 | if (do_cmd_pid > 1) { |
112 | kill(do_cmd_pid, signo); | 112 | kill(do_cmd_pid, signo ? signo : SIGTERM); |
113 | waitpid(do_cmd_pid, NULL, 0); | 113 | waitpid(do_cmd_pid, NULL, 0); |
114 | } | 114 | } |
115 | 115 | ||
116 | _exit(1); | 116 | if (signo) |
117 | _exit(1); | ||
118 | exit(1); | ||
117 | } | 119 | } |
118 | 120 | ||
119 | /* | 121 | /* |
@@ -1072,7 +1074,7 @@ verifydir(char *cp) | |||
1072 | errno = ENOTDIR; | 1074 | errno = ENOTDIR; |
1073 | } | 1075 | } |
1074 | run_err("%s: %s", cp, strerror(errno)); | 1076 | run_err("%s: %s", cp, strerror(errno)); |
1075 | exit(1); | 1077 | killchild(0); |
1076 | } | 1078 | } |
1077 | 1079 | ||
1078 | int | 1080 | int |