summaryrefslogtreecommitdiff
path: root/src/install.c
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2016-01-02 22:14:41 +0000
committerPádraig Brady <P@draigBrady.com>2016-01-03 12:58:39 +0000
commit73055581c9ef167faff210338775f668277603ee (patch)
tree5233a7554d95db3180c39f465c6ad314d6fe695f /src/install.c
parent6c65ce4c643b038c61bd332aab5ea87a75117273 (diff)
downloadcoreutils-73055581c9ef167faff210338775f668277603ee.tar.xz
install: only attempt to create a target dir once
* src/install.c (main): As an optimization, when calling install_file_in_dir() for each file, only attempt to create the target directory once, as this is invariant over the loop.
Diffstat (limited to 'src/install.c')
-rw-r--r--src/install.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/install.c b/src/install.c
index 6efb29e66..3f0ca74c9 100644
--- a/src/install.c
+++ b/src/install.c
@@ -1043,7 +1043,7 @@ main (int argc, char **argv)
dest_info_init (&x);
for (i = 0; i < n_files; i++)
if (! install_file_in_dir (file[i], target_directory, &x,
- mkdir_and_install))
+ i == 0 && mkdir_and_install))
exit_status = EXIT_FAILURE;
}
}