aboutsummaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
Diffstat (limited to 'applets')
-rw-r--r--applets/busybox.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/applets/busybox.c b/applets/busybox.c
index b4939e19d..badd53d79 100644
--- a/applets/busybox.c
+++ b/applets/busybox.c
@@ -37,21 +37,10 @@ typedef int (*__link_f)(const char *, const char *);
37 */ 37 */
38static char *busybox_fullpath() 38static char *busybox_fullpath()
39{ 39{
40 pid_t pid;
41 char path[256];
42 char proc[256]; 40 char proc[256];
43 int len; 41
44 42 sprintf(proc, "/proc/%d/exe", getpid());
45 pid = getpid(); 43 return xreadlink(proc);
46 sprintf(proc, "/proc/%d/exe", pid);
47 len = readlink(proc, path, 256);
48 if (len != -1) {
49 path[len] = 0;
50 } else {
51 perror_msg("%s", proc);
52 return NULL;
53 }
54 return strdup(path);
55} 44}
56 45
57/* create (sym)links for each applet */ 46/* create (sym)links for each applet */