link: new applet

coreutils grew itself a tiny simplistic alternative to ln:

	Usage: link FILE LINK

	Create hard LINK to FILE

function                                             old     new   delta
link_main                                              -      75     +75
packed_usage                                       31114   31131     +17
applet_names                                        2564    2569      +5
applet_main                                         1480    1484      +4
applet_install_loc                                   185     186      +1
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 4/0 up/down: 102/0)             Total: 102 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2017-01-26 00:27:53 +01:00
parent 7dd906a388
commit 06f20bf675
3 changed files with 72 additions and 9 deletions

View File

@@ -127,8 +127,9 @@ void FAST_FUNC data_extract_all(archive_handle_t *archive_handle)
if (hard_link) {
res = link(hard_link, dst_name);
if (res != 0 && !(archive_handle->ah_flags & ARCHIVE_EXTRACT_QUIET)) {
/* shared message */
bb_perror_msg("can't create %slink "
"from %s to %s", "hard",
"%s to %s", "hard",
dst_name,
hard_link);
}
@@ -181,8 +182,9 @@ void FAST_FUNC data_extract_all(archive_handle_t *archive_handle)
if (res != 0
&& !(archive_handle->ah_flags & ARCHIVE_EXTRACT_QUIET)
) {
/* shared message */
bb_perror_msg("can't create %slink "
"from %s to %s", "sym",
"%s to %s", "sym",
dst_name,
file_header->link_target);
}