diff options
Diffstat (limited to 'coreutils/ln.c')
-rw-r--r-- | coreutils/ln.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/coreutils/ln.c b/coreutils/ln.c index 54ced0b89..df183581e 100644 --- a/coreutils/ln.c +++ b/coreutils/ln.c | |||
@@ -11,10 +11,6 @@ | |||
11 | /* BB_AUDIT GNU options missing: -d, -F, -i, and -v. */ | 11 | /* BB_AUDIT GNU options missing: -d, -F, -i, and -v. */ |
12 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/ln.html */ | 12 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/ln.html */ |
13 | 13 | ||
14 | #include <stdio.h> | ||
15 | #include <stdlib.h> | ||
16 | #include <unistd.h> | ||
17 | #include <errno.h> | ||
18 | #include "busybox.h" | 14 | #include "busybox.h" |
19 | 15 | ||
20 | #define LN_SYMLINK 1 | 16 | #define LN_SYMLINK 1 |
@@ -45,7 +41,7 @@ int ln_main(int argc, char **argv) | |||
45 | 41 | ||
46 | if (argc == optind + 1) { | 42 | if (argc == optind + 1) { |
47 | *--argv = last; | 43 | *--argv = last; |
48 | last = bb_get_last_path_component(bb_xstrdup(last)); | 44 | last = bb_get_last_path_component(xstrdup(last)); |
49 | } | 45 | } |
50 | 46 | ||
51 | do { | 47 | do { |
@@ -55,7 +51,7 @@ int ln_main(int argc, char **argv) | |||
55 | if (is_directory(src, | 51 | if (is_directory(src, |
56 | (flag & LN_NODEREFERENCE) ^ LN_NODEREFERENCE, | 52 | (flag & LN_NODEREFERENCE) ^ LN_NODEREFERENCE, |
57 | NULL)) { | 53 | NULL)) { |
58 | src_name = bb_xstrdup(*argv); | 54 | src_name = xstrdup(*argv); |
59 | src = concat_path_file(src, bb_get_last_path_component(src_name)); | 55 | src = concat_path_file(src, bb_get_last_path_component(src_name)); |
60 | free(src_name); | 56 | free(src_name); |
61 | src_name = src; | 57 | src_name = src; |
@@ -69,7 +65,7 @@ int ln_main(int argc, char **argv) | |||
69 | 65 | ||
70 | if (flag & LN_BACKUP) { | 66 | if (flag & LN_BACKUP) { |
71 | char *backup; | 67 | char *backup; |
72 | backup = bb_xasprintf("%s%s", src, suffix); | 68 | backup = xasprintf("%s%s", src, suffix); |
73 | if (rename(src, backup) < 0 && errno != ENOENT) { | 69 | if (rename(src, backup) < 0 && errno != ENOENT) { |
74 | bb_perror_msg("%s", src); | 70 | bb_perror_msg("%s", src); |
75 | status = EXIT_FAILURE; | 71 | status = EXIT_FAILURE; |