summaryrefslogtreecommitdiff
path: root/emulators/qemu-devel/files/patch-vl.c
diff options
context:
space:
mode:
Diffstat (limited to 'emulators/qemu-devel/files/patch-vl.c')
-rw-r--r--emulators/qemu-devel/files/patch-vl.c28
1 files changed, 0 insertions, 28 deletions
diff --git a/emulators/qemu-devel/files/patch-vl.c b/emulators/qemu-devel/files/patch-vl.c
deleted file mode 100644
index f27241c0a067..000000000000
--- a/emulators/qemu-devel/files/patch-vl.c
+++ /dev/null
@@ -1,28 +0,0 @@
-Index: qemu/vl.c
-@@ -57,6 +57,8 @@
- #include <sys/stat.h>
- #if defined(__FreeBSD__) || defined(__DragonFly__)
- #include <libutil.h>
-+#include <sys/param.h>
-+#include <sys/sysctl.h>
- #else
- #include <util.h>
- #endif
-@@ -3368,10 +3369,13 @@ static char *find_datadir(const char *ar
- }
- #elif defined(__FreeBSD__)
- {
-- int len;
-- len = readlink("/proc/curproc/file", buf, sizeof(buf) - 1);
-- if (len > 0) {
-- buf[len] = 0;
-+ static int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1};
-+ size_t len = sizeof(buf) - 1;
-+
-+ *buf = '\0';
-+ if (!sysctl(mib, sizeof(mib)/sizeof(*mib), buf, &len, NULL, 0) &&
-+ *buf) {
-+ buf[sizeof(buf) - 1] = '\0';
- p = buf;
- }
- }