summaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
authorDenis Vlasenko2007-06-08 15:02:55 +0000
committerDenis Vlasenko2007-06-08 15:02:55 +0000
commitbdbbb7ec49040563628758a2581a5f8e44f53277 (patch)
tree040fdad2cf7f793717c7088c24047b654732541b /applets
parentc14d39e83a7f55ab9b92e98673a281fd6565c32d (diff)
downloadbusybox-bdbbb7ec49040563628758a2581a5f8e44f53277.zip
busybox-bdbbb7ec49040563628758a2581a5f8e44f53277.tar.gz
make busybox --install work even if /proc/self/exe doesn't exist
# size busybox_old busybox_unstripped text data bss dec hex filename 680095 2704 15648 698447 aa84f busybox_old 680099 2704 15648 698451 aa853 busybox_unstripped
Diffstat (limited to 'applets')
-rw-r--r--applets/applets.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/applets/applets.c b/applets/applets.c
index bd37043..f341242 100644
--- a/applets/applets.c
+++ b/applets/applets.c
@@ -577,21 +577,13 @@ static int busybox_main(char **argv)
}
if (ENABLE_FEATURE_INSTALLER && strcmp(argv[1], "--install") == 0) {
- int use_symbolic_links = 0;
- char *busybox;
-
- /* to use symlinks, or not to use symlinks... */
- if (argv[2])
- if (strcmp(argv[2], "-s") == 0)
- use_symbolic_links = 1;
-
- /* link */
- busybox = xmalloc_readlink_or_warn("/proc/self/exe");
+ const char *busybox;
+ busybox = xmalloc_readlink_or_warn(bb_busybox_exec_path);
if (!busybox)
- return 1;
- install_links(busybox, use_symbolic_links);
- if (ENABLE_FEATURE_CLEAN_UP)
- free(busybox);
+ busybox = bb_busybox_exec_path;
+ /* -s makes symlinks */
+ install_links(busybox,
+ argv[2] && strcmp(argv[2], "-s") == 0);
return 0;
}