aboutsummaryrefslogtreecommitdiff
path: root/coreutils/install.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/install.c')
-rw-r--r--coreutils/install.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/coreutils/install.c b/coreutils/install.c
index e9682990d..803afe617 100644
--- a/coreutils/install.c
+++ b/coreutils/install.c
@@ -167,12 +167,23 @@ int install_main(int argc, char **argv)
167 free(ddir); 167 free(ddir);
168 } 168 }
169 if (isdir) 169 if (isdir)
170 dest = concat_path_file(last, basename(arg)); 170 dest = concat_path_file(last, bb_basename(arg));
171 if (copy_file(arg, dest, copy_flags)) { 171 if (copy_file(arg, dest, copy_flags) != 0) {
172 /* copy is not made */ 172 /* copy is not made */
173 ret = EXIT_FAILURE; 173 ret = EXIT_FAILURE;
174 goto next; 174 goto next;
175 } 175 }
176 if (opts & OPT_STRIP) {
177 char *args[4];
178 args[0] = (char*)"strip";
179 args[1] = (char*)"-p"; /* -p --preserve-dates */
180 args[2] = dest;
181 args[3] = NULL;
182 if (spawn_and_wait(args)) {
183 bb_perror_msg("strip");
184 ret = EXIT_FAILURE;
185 }
186 }
176 } 187 }
177 188
178 /* Set the file mode (always, not only with -m). 189 /* Set the file mode (always, not only with -m).
@@ -192,16 +203,6 @@ int install_main(int argc, char **argv)
192 bb_perror_msg("can't change %s of %s", "ownership", dest); 203 bb_perror_msg("can't change %s of %s", "ownership", dest);
193 ret = EXIT_FAILURE; 204 ret = EXIT_FAILURE;
194 } 205 }
195 if (opts & OPT_STRIP) {
196 char *args[3];
197 args[0] = (char*)"strip";
198 args[1] = dest;
199 args[2] = NULL;
200 if (spawn_and_wait(args)) {
201 bb_perror_msg("strip");
202 ret = EXIT_FAILURE;
203 }
204 }
205 next: 206 next:
206 if (ENABLE_FEATURE_CLEAN_UP && isdir) 207 if (ENABLE_FEATURE_CLEAN_UP && isdir)
207 free(dest); 208 free(dest);