Another update from Larry:
[oweals/busybox.git] / busybox.c
index b4939e19d319a5dea4a3fbea596e7317921ec70f..badd53d79de9a7c28dc34fbf1c46903d1f96e8b1 100644 (file)
--- a/busybox.c
+++ b/busybox.c
@@ -37,21 +37,10 @@ typedef int (*__link_f)(const char *, const char *);
  */
 static char *busybox_fullpath()
 {
-       pid_t pid;
-       char path[256];
        char proc[256];
-       int len;
-
-       pid = getpid();
-       sprintf(proc, "/proc/%d/exe", pid);
-       len = readlink(proc, path, 256);
-       if (len != -1) {
-               path[len] = 0;
-       } else {
-               perror_msg("%s", proc);
-               return NULL;
-       }
-       return strdup(path);
+
+       sprintf(proc, "/proc/%d/exe", getpid());
+       return xreadlink(proc);
 }
 
 /* create (sym)links for each applet */