summaryrefslogtreecommitdiffhomepage
path: root/coreutils/ln.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-08-03 15:41:12 +0000
committerRob Landley <rob@landley.net>2006-08-03 15:41:12 +0000
commitd921b2ecc0d294ad4bf8c7458fc52a60c28727d2 (patch)
treee4a2769349867c441cf2983d83097bb66701a733 /coreutils/ln.c
parent6dce0b6fa79f2d4bb7e9d90e1fbc0f6beb25f855 (diff)
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.)
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 @@
/* BB_AUDIT GNU options missing: -d, -F, -i, and -v. */
/* http://www.opengroup.org/onlinepubs/007904975/utilities/ln.html */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
#include "busybox.h"
#define LN_SYMLINK 1
@@ -45,7 +41,7 @@ int ln_main(int argc, char **argv)
if (argc == optind + 1) {
*--argv = last;
- last = bb_get_last_path_component(bb_xstrdup(last));
+ last = bb_get_last_path_component(xstrdup(last));
}
do {
@@ -55,7 +51,7 @@ int ln_main(int argc, char **argv)
if (is_directory(src,
(flag & LN_NODEREFERENCE) ^ LN_NODEREFERENCE,
NULL)) {
- src_name = bb_xstrdup(*argv);
+ src_name = xstrdup(*argv);
src = concat_path_file(src, bb_get_last_path_component(src_name));
free(src_name);
src_name = src;
@@ -69,7 +65,7 @@ int ln_main(int argc, char **argv)
if (flag & LN_BACKUP) {
char *backup;
- backup = bb_xasprintf("%s%s", src, suffix);
+ backup = xasprintf("%s%s", src, suffix);
if (rename(src, backup) < 0 && errno != ENOENT) {
bb_perror_msg("%s", src);
status = EXIT_FAILURE;