diff options
Diffstat (limited to 'busybox.c')
-rw-r--r-- | busybox.c | 23 |
1 files changed, 16 insertions, 7 deletions
@@ -10,6 +10,10 @@ | |||
10 | #define BB_DECLARE_EXTERN | 10 | #define BB_DECLARE_EXTERN |
11 | #include "messages.c" | 11 | #include "messages.c" |
12 | 12 | ||
13 | #ifdef BB_LOCALE_SUPPORT | ||
14 | #include <locale.h> | ||
15 | #endif | ||
16 | |||
13 | int been_there_done_that = 0; /* Also used in applets.c */ | 17 | int been_there_done_that = 0; /* Also used in applets.c */ |
14 | const char *applet_name; | 18 | const char *applet_name; |
15 | 19 | ||
@@ -60,7 +64,7 @@ static void install_links(const char *busybox, int use_symbolic_links) | |||
60 | { | 64 | { |
61 | __link_f Link = link; | 65 | __link_f Link = link; |
62 | 66 | ||
63 | char command[256]; | 67 | char *fpc; |
64 | int i; | 68 | int i; |
65 | int rc; | 69 | int rc; |
66 | 70 | ||
@@ -68,13 +72,13 @@ static void install_links(const char *busybox, int use_symbolic_links) | |||
68 | Link = symlink; | 72 | Link = symlink; |
69 | 73 | ||
70 | for (i = 0; applets[i].name != NULL; i++) { | 74 | for (i = 0; applets[i].name != NULL; i++) { |
71 | sprintf ( command, "%s/%s", | 75 | fpc = concat_path_file( |
72 | install_dir[applets[i].location], applets[i].name); | 76 | install_dir[applets[i].location], applets[i].name); |
73 | rc = Link(busybox, command); | 77 | rc = Link(busybox, fpc); |
74 | 78 | if (rc!=0 && errno!=EEXIST) { | |
75 | if (rc) { | 79 | perror_msg("%s", fpc); |
76 | perror_msg("%s", command); | ||
77 | } | 80 | } |
81 | free(fpc); | ||
78 | } | 82 | } |
79 | } | 83 | } |
80 | 84 | ||
@@ -97,6 +101,11 @@ int main(int argc, char **argv) | |||
97 | } | 101 | } |
98 | #endif | 102 | #endif |
99 | 103 | ||
104 | #ifdef BB_LOCALE_SUPPORT | ||
105 | if(getpid()!=1) /* Do not set locale for `init' */ | ||
106 | setlocale(LC_ALL, ""); | ||
107 | #endif | ||
108 | |||
100 | run_applet_by_name(applet_name, argc, argv); | 109 | run_applet_by_name(applet_name, argc, argv); |
101 | error_msg_and_die("applet not found"); | 110 | error_msg_and_die("applet not found"); |
102 | } | 111 | } |