aboutsummaryrefslogtreecommitdiff
path: root/coreutils/ln.c
diff options
context:
space:
mode:
authorlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-08-03 15:41:12 +0000
committerlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-08-03 15:41:12 +0000
commit5e2a5391f9142bca773aab4c829615895b69a6b7 (patch)
treee4a2769349867c441cf2983d83097bb66701a733 /coreutils/ln.c
parente883e03918a0e26e390ea23996abdb8fc1925f88 (diff)
downloadbusybox-w32-5e2a5391f9142bca773aab4c829615895b69a6b7.tar.gz
busybox-w32-5e2a5391f9142bca773aab4c829615895b69a6b7.tar.bz2
busybox-w32-5e2a5391f9142bca773aab4c829615895b69a6b7.zip
Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only had one user), clean up lots of #includes... General cleanup pass. What I've been doing for the last couple days. And it conflicts! I've removed httpd.c from this checkin due to somebody else touching that file. It builds for me. I have to catch a bus. (Now you know why I'm looking forward to Mercurial.) git-svn-id: svn://busybox.net/trunk/busybox@15767 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'coreutils/ln.c')
-rw-r--r--coreutils/ln.c10
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;